Interface FileLocations

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 Type
    Method
    Description
    Returns the project root for the given resource handle.
     
    Returns the source folder the given handle is contained in or null if the given Path is not located in a source folder.
    getTargetFolder(Path sourceFolder)
    Returns the target folder for the given source folder or null if the given folder is not a source folder or doesn't have a configured target folder.
  • Method Details

    • getSourceFolder

      Path getSourceFolder(Path path)
      Returns the source folder the given handle is contained in or null if the given Path is 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 null if the given Path is not located in a source folder.
      See Also:
    • getTargetFolder

      Path getTargetFolder(Path sourceFolder)
      Returns the target folder for the given source folder or null if 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

      Path getProjectFolder(Path path)
      Returns the project root for the given resource handle.
      Parameters:
      path - an absolute path
      Returns:
      the project's root
    • getProjectSourceFolders

      Set<Path> getProjectSourceFolders(Path path)
      Parameters:
      path - an absolute path
      Returns:
      the source folders of the project the given path is contained in
      Since:
      2.8