use of com.blackducksoftware.integration.hub.detect.workflow.search.result.FileNotFoundDetectorResult in project hub-detect by blackducksoftware.
the class GoVendorDetector method applicable.
@Override
public DetectorResult applicable() {
File vendorDir = fileFinder.findFile(environment.getDirectory(), VENDOR_JSON_DIRNAME);
if (vendorDir == null) {
logger.trace(String.format("Dir %s not found", VENDOR_JSON_DIRNAME));
return new FileNotFoundDetectorResult(VENDOR_JSON_FILENAME);
}
vendorJson = fileFinder.findFile(vendorDir, VENDOR_JSON_FILENAME);
if (vendorJson == null) {
logger.trace(String.format("File %s not found", VENDOR_JSON_FILENAME));
return new FileNotFoundDetectorResult(VENDOR_JSON_FILENAME);
}
logger.trace(String.format("%s/%s found", VENDOR_JSON_DIRNAME, VENDOR_JSON_FILENAME));
return new PassedDetectorResult();
}
use of com.blackducksoftware.integration.hub.detect.workflow.search.result.FileNotFoundDetectorResult in project hub-detect by blackducksoftware.
the class NpmCliDetector method applicable.
@Override
public DetectorResult applicable() {
final File packageJson = fileFinder.findFile(environment.getDirectory(), PACKAGE_JSON);
if (packageJson == null) {
return new FileNotFoundDetectorResult(PACKAGE_JSON);
}
addRelevantDiagnosticFile(packageJson);
return new PassedDetectorResult();
}
use of com.blackducksoftware.integration.hub.detect.workflow.search.result.FileNotFoundDetectorResult in project hub-detect by blackducksoftware.
the class NpmPackageLockDetector method applicable.
@Override
public DetectorResult applicable() {
lockfile = fileFinder.findFile(environment.getDirectory(), PACKAGE_LOCK_JSON);
if (lockfile == null) {
return new FileNotFoundDetectorResult(PACKAGE_LOCK_JSON);
}
File foundPackageJson = fileFinder.findFile(environment.getDirectory(), PACKAGE_JSON);
if (foundPackageJson == null) {
logger.warn("Npm applied but it could not find a package.json so dependencies may not be entirely accurate.");
} else {
packageJson = Optional.of(foundPackageJson);
}
return new PassedDetectorResult();
}
use of com.blackducksoftware.integration.hub.detect.workflow.search.result.FileNotFoundDetectorResult in project hub-detect by blackducksoftware.
the class NpmShrinkwrapDetector method applicable.
@Override
public DetectorResult applicable() {
lockfile = fileFinder.findFile(environment.getDirectory(), SHRINKWRAP_JSON);
if (lockfile == null) {
return new FileNotFoundDetectorResult(SHRINKWRAP_JSON);
}
File foundPackageJson = fileFinder.findFile(environment.getDirectory(), PACKAGE_JSON);
if (foundPackageJson == null) {
logger.warn("Npm applied but it could not find a package.json so dependencies may not be entirely accurate.");
} else {
packageJson = Optional.of(foundPackageJson);
}
return new PassedDetectorResult();
}
Aggregations