Class ResourcesRootPackageFinder

    • Constructor Detail

      • ResourcesRootPackageFinder

        public ResourcesRootPackageFinder​(Path resourcesRoot,
                                          JavaPackageFinder fallbackFinder)
    • Method Detail

      • getResourcesRoot

        public Path getResourcesRoot()
      • findJavaPackageFolder

        public Path findJavaPackageFolder​(Path pathRelativeToProjectRoot)
        Description copied from interface: JavaPackageFinder
        Given the relative path to a file under the project root, return the Java package with which the file is associated. For .java files, this is generally obvious, as they contain an explicit "package" statement. For other files, such as resources, other heuristics must be used.
        Specified by:
        findJavaPackageFolder in interface JavaPackageFinder
        pathRelativeToProjectRoot - may be a path to either a file or a directory. If a directory, then it must end in a slash.
        a path that always ends with a slash, or the empty string, indicating the root directory.