hudson.plugins.analysis.util
Class ModuleDetector

java.lang.Object
  extended by hudson.plugins.analysis.util.ModuleDetector
Direct Known Subclasses:
NullModuleDetector

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:
Ulli Hafner, Christoph Laeubrich (support for OSGi-Bundles)

Constructor Summary
protected ModuleDetector()
          Creates a new instance of ModuleDetector.
  ModuleDetector(File workspace)
          Creates a new instance of ModuleDetector.
 
Method Summary
 String guessModuleName(String originalFileName)
          Uses the path prefixes of pom.xml or build.xml files to guess a module name for the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleDetector

protected ModuleDetector()
Creates a new instance of ModuleDetector.


ModuleDetector

public ModuleDetector(File workspace)
Creates a new instance of ModuleDetector.

Parameters:
workspace - the workspace to scan for Maven pom.xml or Ant build.xml files
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


Copyright © 2004-2012 Hudson. All Rights Reserved.