|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PathResolver
Allows resolution between File
, Path
and canonical path String
s.
Add-ons should use this class as their primary mechanism to resolve paths in order to maximize
future compatibility with any design refactoring, project structural enhancements or alternate
build systems. Add-ons should generally avoid using File
directly.
Method Summary | |
---|---|
String |
getFriendlyName(String identifier)
Converts the presented canonical path into a human-friendly name. |
String |
getIdentifier(Path path,
String relativePath)
Produces a canonical path for the presented Path and relative path. |
List<Path> |
getNonSourcePaths()
Similar to getSourcePaths() , but only returns Path s which are not compiled. |
Path |
getPath(String identifier)
Attempts to determine which Path the specified canonical path falls under. |
List<Path> |
getPaths()
Returns all paths supported by the implementation, in an order defined by the implementation. |
String |
getRelativeSegment(String identifier)
Attempts to determine which Path the specified canonical path falls under,
and then returns the relative portion of the file name. |
String |
getRoot(Path path)
Returns a canonical path that represents the root of the presented Path . |
List<Path> |
getSourcePaths()
Indicates all the source code Path s known to this PathResolver . |
Method Detail |
---|
String getIdentifier(Path path, String relativePath)
Path
and relative path.
path
- to use (required)relativePath
- to use (cannot be null, but may be empty if referring to the path itself)
Path getPath(String identifier)
Path
the specified canonical path falls under.
identifier
- to lookup (required)
Path
, or null if the identifier refers to a location not under a know path.String getRoot(Path path)
Path
.
path
- to lookup (required)
String getRelativeSegment(String identifier)
Path
the specified canonical path falls under,
and then returns the relative portion of the file name.
See FileDetails.getRelativeSegment(String)
for related information.
identifier
- to resolve (required)
Path
directly), or null if the identifier does not have a corresponding Path
String getFriendlyName(String identifier)
identifier
- to resolve (required)
List<Path> getSourcePaths()
Path
s known to this PathResolver
.
Whilst generally add-ons should know which paths contain source and which do not, this method abstracts add-ons from direct knowledge of available paths.
By default this method will return, in the following order:
List<Path> getNonSourcePaths()
getSourcePaths()
, but only returns Path
s which are not compiled.
By default this method will return, in the following order:
List<Path> getPaths()
By default this method will return, in the following order:
Path.SRC_MAIN_JAVA
Path.SRC_MAIN_RESOURCES
Path.SRC_MAIN_WEBAPP
Path.SRC_TEST_JAVA
Path.SRC_TEST_RESOURCES
Path.ROOT
Path.SPRING_CONFIG_ROOT
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |