Search in sources :

Example 1 with GivenFileNotFoundDetectableResult

use of com.synopsys.integration.detectable.detectable.result.GivenFileNotFoundDetectableResult in project synopsys-detect by blackducksoftware.

the class ConanLockfileDetectable method extractable.

@Override
public DetectableResult extractable() throws DetectableException {
    if (conanLockfileExtractorOptions.getLockfilePath().isPresent()) {
        Path givenLockfilePath = conanLockfileExtractorOptions.getLockfilePath().get();
        File userProvidedLockfile = givenLockfilePath.toFile();
        if (userProvidedLockfile.exists()) {
            lockfile = userProvidedLockfile;
        } else {
            logger.debug("File {} does not exist", givenLockfilePath);
            return new GivenFileNotFoundDetectableResult(givenLockfilePath.toString());
        }
    }
    return new PassedDetectableResult();
}
Also used : Path(java.nio.file.Path) GivenFileNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.GivenFileNotFoundDetectableResult) FoundFile(com.synopsys.integration.detectable.detectable.explanation.FoundFile) File(java.io.File) PassedDetectableResult(com.synopsys.integration.detectable.detectable.result.PassedDetectableResult)

Aggregations

FoundFile (com.synopsys.integration.detectable.detectable.explanation.FoundFile)1 GivenFileNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.GivenFileNotFoundDetectableResult)1 PassedDetectableResult (com.synopsys.integration.detectable.detectable.result.PassedDetectableResult)1 File (java.io.File)1 Path (java.nio.file.Path)1