Interface IBowirePathResolver

Namespace
Kuestenlogik.Bowire.Projects
Assembly
Kuestenlogik.Bowire.dll

Resolves where Bowire stores things.

public interface IBowirePathResolver

Remarks

Injected rather than called statically, because the answer depends on how the host was configured and that decision should be made once and passed down. Before this existed, fourteen files across six assemblies each wrote Path.Combine(GetFolderPath(UserProfile), ".bowire", …) — which meant the machine scope and the instance segment below could only ever have reached the stores that happened to route through BowireUserContext, and silently missed the plugin directory, the proxy CA, the vuln-db cache and the MCP stores.

The two environment variables are read here and nowhere else. That is the point of the type: BOWIRE_DATA_DIR is only a usable test override if pointing it at one directory redirects everything, and BOWIRE_INSTANCE only separates instances if it separates all of their state rather than the half that went through one helper.

Methods

Resolve(BowireStorageScope, params string[])

An absolute path under scope's root.

string Resolve(BowireStorageScope scope, params string[] segments)

Parameters

scope BowireStorageScope

Which root to resolve under.

segments string[]

Relative segments — "plugins", "collections.json". Rooted segments are rejected rather than silently replacing the root, which is what Combine(string, string) would do.

Returns

string

Root(BowireStorageScope)

The root for scope, with no segments added.

string Root(BowireStorageScope scope)

Parameters

scope BowireStorageScope

Returns

string