Class PathResolver
java.lang.Object
network.ike.plugin.scaffold.PathResolver
Expands manifest
dest strings to absolute filesystem paths.
Conventions:
ScaffoldScope.USERentries start with"~/"and resolve against the caller-supplied user home.ScaffoldScope.PROJECTentries may optionally start with"{project.root}/"(the literal token, not a property reference); both forms resolve against the project-root path passed in.
-
Constructor Summary
ConstructorsConstructorDescriptionPathResolver(Path userHome, Path projectRoot) Construct a resolver bound to the given user-home and project-root anchors. -
Method Summary
Modifier and TypeMethodDescriptionresolve(ManifestEntry entry) Resolve a manifest entry to an absolute path.resolveDest(String dest, ScaffoldScope scope) Resolve a baredeststring to an absolute path.
-
Constructor Details
-
PathResolver
Construct a resolver bound to the given user-home and project-root anchors. Either anchor may be used at resolve time depending on the scope of the manifest entry;projectRootmay be omitted when only USER-scope resolution is required.- Parameters:
userHome- absolute path to the user's home directory; required for USER-scope entriesprojectRoot- absolute path to the current project's root; required for PROJECT-scope entries. May benullwhen only USER-scope resolution is expected (e.g. fresh-machine bootstrap).
-
-
Method Details
-
resolve
Resolve a manifest entry to an absolute path.- Parameters:
entry- the manifest entry- Returns:
- absolute, normalised path
- Throws:
ScaffoldException- if the entry's scope does not match the available roots or the dest form is inconsistent with its scope
-
resolveDest
Resolve a baredeststring to an absolute path.Used for lockfile entries that have no surviving manifest counterpart (orphans) — the scope is inferred by the caller from which lockfile the
destcame out of.- Parameters:
dest- the manifestdeststringscope- the scope to resolve under- Returns:
- absolute, normalised path
- Throws:
ScaffoldException- if the dest form is inconsistent with its scope or the required root is unavailable
-