hudson.plugins.tasks.util.AbstractPackageDetector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tasks Show documentation
Show all versions of tasks Show documentation
This plug-in scans the workspace files for open tasks
and generates a trend report.
package hudson.plugins.tasks.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
/**
* Base class for package detectors.
*
* @author Ulli Hafner
*/
public abstract class AbstractPackageDetector implements PackageDetector {
/** Identifies an unknown package. */
protected static final String UNKNOWN_PACKAGE = "-";
/** {@inheritDoc} */
public String detectPackageName(final String fileName) {
try {
if (accepts(fileName)) {
return detectPackageName(new FileInputStream(new File(fileName)));
}
}
catch (FileNotFoundException exception) {
// ignore and return empty string
}
return UNKNOWN_PACKAGE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy