- All Known Subinterfaces:
CodeGenerationContext,RegisterGlobalsContext,TransformationContext,ValidationContext
@Beta
public interface FileLocations
A service which provides information about the location of a path.
- Author:
- Sven Efftinge
-
Method Summary
Modifier and TypeMethodDescriptiongetProjectFolder(Path path) Returns the project root for the given resource handle.getProjectSourceFolders(Path path) getSourceFolder(Path path) Returns the source folder the given handle is contained in ornullif the givenPathis not located in a source folder.getTargetFolder(Path sourceFolder) Returns the target folder for the given source folder ornullif the given folder is not a source folder or doesn't have a configured target folder.
-
Method Details
-
getSourceFolder
Returns the source folder the given handle is contained in ornullif the givenPathis not located in a source folder.- Parameters:
path- an absolute path to a resource- Returns:
- the source folder the given handle is contained in or
nullif the givenPathis not located in a source folder. - See Also:
-
getTargetFolder
Returns the target folder for the given source folder ornullif the given folder is not a source folder or doesn't have a configured target folder.- Parameters:
sourceFolder- the source folder to find the configured target folder for.- Returns:
- the target folder
-
getProjectFolder
Returns the project root for the given resource handle.- Parameters:
path- an absolute path- Returns:
- the project's root
-
getProjectSourceFolders
- Parameters:
path- an absolute path- Returns:
- the source folders of the project the given path is contained in
- Since:
- 2.8
-