Package edu.hm.hafner.analysis
Class ModuleDetector
- java.lang.Object
-
- edu.hm.hafner.analysis.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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceModuleDetector.FileSystemFacade for file system operations.
-
Constructor Summary
Constructors Constructor Description ModuleDetector(Path workspace, ModuleDetector.FileSystem fileSystem)Creates a new instance ofModuleDetector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringguessModuleName(String originalFileName)Uses the path prefixes of pom.xml or build.xml files to guess a module name for the specified file.
-
-
-
Constructor Detail
-
ModuleDetector
public ModuleDetector(Path workspace, ModuleDetector.FileSystem fileSystem)
Creates a new instance ofModuleDetector.- Parameters:
workspace- the workspace to scan for Maven pom.xml or ant build.xml filesfileSystem- 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
-
-