Class ModuleDetector


  • public class ModuleDetector
    extends Object
    Detects module names by parsing the name of a source file, the Maven pom.xml file or the ANT build.xml file.
    Author:
    Ullrich Hafner, Christoph Laeubrich (support for OSGi-Bundles)
    • Constructor Detail

      • ModuleDetector

        public ModuleDetector​(Path workspace,
                              ModuleDetector.FileSystem fileSystem)
        Creates a new instance of ModuleDetector.
        Parameters:
        workspace - the workspace to scan for Maven pom.xml or ant build.xml files
        fileSystem - file system facade to find and load files with
    • Method Detail

      • guessModuleName

        public String guessModuleName​(String originalFileName)
        Uses the path prefixes of pom.xml or build.xml files to guess a module name for the specified file.
        Parameters:
        originalFileName - file name to guess a module for, must be an absolute path
        Returns:
        a module name or an empty string