findJavaPackageFolder
public Path findJavaPackageFolder(Path pathRelativeToProjectRoot)
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
- Parameters:
pathRelativeToProjectRoot
- may be a path to either a file or a directory. If a directory,
then it must end in a slash.
- Returns:
- a path that always ends with a slash, or the empty string, indicating the root
directory.