Search in sources :

Example 1 with PassedResultBuilder

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

the class PipenvDetectable method applicable.

@Override
public DetectableResult applicable() {
    File pipfile = fileFinder.findFile(environment.getDirectory(), PIPFILE_FILE_NAME);
    File pipfileDotLock = fileFinder.findFile(environment.getDirectory(), PIPFILE_DOT_LOCK_FILE_NAME);
    if (pipfile != null || pipfileDotLock != null) {
        PassedResultBuilder passedResultBuilder = new PassedResultBuilder();
        passedResultBuilder.foundNullableFile(pipfile);
        passedResultBuilder.foundNullableFile(pipfileDotLock);
        return passedResultBuilder.build();
    } else {
        return new FilesNotFoundDetectableResult(PIPFILE_FILE_NAME, PIPFILE_DOT_LOCK_FILE_NAME);
    }
}
Also used : PassedResultBuilder(com.synopsys.integration.detectable.detectable.PassedResultBuilder) FilesNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.FilesNotFoundDetectableResult) File(java.io.File)

Example 2 with PassedResultBuilder

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

the class GoDepLockDetectable method applicable.

@Override
public DetectableResult applicable() {
    PassedResultBuilder passedResultBuilder = new PassedResultBuilder();
    goLock = fileFinder.findFile(environment.getDirectory(), GOPKG_LOCK_FILENAME);
    if (goLock == null) {
        goToml = fileFinder.findFile(environment.getDirectory(), GOFILE_FILENAME_PATTERN);
        if (goToml == null) {
            return new FilesNotFoundDetectableResult(GOPKG_LOCK_FILENAME, GOFILE_FILENAME_PATTERN);
        } else {
            passedResultBuilder.foundFile(goToml);
        }
    } else {
        passedResultBuilder.foundFile(goLock);
    }
    return passedResultBuilder.build();
}
Also used : PassedResultBuilder(com.synopsys.integration.detectable.detectable.PassedResultBuilder) FilesNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.FilesNotFoundDetectableResult)

Example 3 with PassedResultBuilder

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

the class PipenvDetectable method applicable.

@Override
public DetectableResult applicable() {
    File pipfile = fileFinder.findFile(environment.getDirectory(), PIPFILE_FILE_NAME);
    File pipfileDotLock = fileFinder.findFile(environment.getDirectory(), PIPFILE_DOT_LOCK_FILE_NAME);
    if (pipfile != null || pipfileDotLock != null) {
        PassedResultBuilder passedResultBuilder = new PassedResultBuilder();
        passedResultBuilder.foundNullableFile(pipfile);
        passedResultBuilder.foundNullableFile(pipfileDotLock);
        return passedResultBuilder.build();
    } else {
        return new FilesNotFoundDetectableResult(PIPFILE_FILE_NAME, PIPFILE_DOT_LOCK_FILE_NAME);
    }
}
Also used : PassedResultBuilder(com.synopsys.integration.detectable.detectable.PassedResultBuilder) FilesNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.FilesNotFoundDetectableResult) File(java.io.File)

Example 4 with PassedResultBuilder

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

the class NugetProjectDetectable method applicable.

@Override
public DetectableResult applicable() {
    projectFiles = fileFinder.findFiles(environment.getDirectory(), SUPPORTED_PROJECT_PATTERNS);
    if (projectFiles != null && projectFiles.size() > 0) {
        PassedResultBuilder passedResultBuilder = new PassedResultBuilder();
        projectFiles.forEach(passedResultBuilder::foundFile);
        return passedResultBuilder.build();
    } else {
        return new FilesNotFoundDetectableResult(SUPPORTED_PROJECT_PATTERNS);
    }
}
Also used : PassedResultBuilder(com.synopsys.integration.detectable.detectable.PassedResultBuilder) FilesNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.FilesNotFoundDetectableResult)

Example 5 with PassedResultBuilder

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

the class NugetSolutionDetectable method applicable.

@Override
public DetectableResult applicable() {
    solutionFiles = fileFinder.findFiles(environment.getDirectory(), SUPPORTED_SOLUTION_PATTERNS);
    if (solutionFiles != null && solutionFiles.size() > 0) {
        PassedResultBuilder passedResultBuilder = new PassedResultBuilder();
        solutionFiles.forEach(passedResultBuilder::foundFile);
        return passedResultBuilder.build();
    } else {
        return new FilesNotFoundDetectableResult(SUPPORTED_SOLUTION_PATTERNS);
    }
}
Also used : PassedResultBuilder(com.synopsys.integration.detectable.detectable.PassedResultBuilder) FilesNotFoundDetectableResult(com.synopsys.integration.detectable.detectable.result.FilesNotFoundDetectableResult)

Aggregations

PassedResultBuilder (com.synopsys.integration.detectable.detectable.PassedResultBuilder)7 FilesNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.FilesNotFoundDetectableResult)5 File (java.io.File)3 DetectableException (com.synopsys.integration.detectable.detectable.exception.DetectableException)1 ExecutableNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.ExecutableNotFoundDetectableResult)1 FileNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.FileNotFoundDetectableResult)1 InspectorNotFoundDetectableResult (com.synopsys.integration.detectable.detectable.result.InspectorNotFoundDetectableResult)1 ExecutableRunnerException (com.synopsys.integration.executable.ExecutableRunnerException)1 IOException (java.io.IOException)1