Package com.optum.sourcehawk.exec.scan
Class ScanResultFactory
- java.lang.Object
-
- com.optum.sourcehawk.exec.scan.ScanResultFactory
-
public final class ScanResultFactory extends Object
A factory for creating instances ofScanResult- Author:
- Brian Wyka
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScanResultenforcerResult(ExecOptions execOptions, String repositoryPath, Severity severity, com.optum.sourcehawk.enforcer.EnforcerResult enforcerResult)Create a scan result based on the file protocol and enforcer resultstatic ScanResulterror(String repositoryPath, String message)Create the scan result for situations where there is an error executing the scanstatic ScanResultfileNotFound(ExecOptions execOptions, FileProtocol fileProtocol)Generate a scan result for situations where the file is not foundstatic ScanResultfileNotFound(ExecOptions execOptions, String repositoryPath, String fileProtocolSeverity)Generate a scan result for situations where the file is not foundstatic ScanResultglobalError(Throwable throwable)Create the scan result for situations where there is an exception executing the scan
-
-
-
Method Detail
-
enforcerResult
public static ScanResult enforcerResult(ExecOptions execOptions, String repositoryPath, Severity severity, com.optum.sourcehawk.enforcer.EnforcerResult enforcerResult)
Create a scan result based on the file protocol and enforcer result- Parameters:
execOptions- the exec optionsrepositoryPath- the path to the file in the repositoryseverity- the severity of the file protocolenforcerResult- the result of the enforcer- Returns:
- the derived scan result
-
error
public static ScanResult error(String repositoryPath, String message)
Create the scan result for situations where there is an error executing the scan- Parameters:
repositoryPath- the path to the file in the repositorymessage- the error message- Returns:
- the scan result
-
globalError
public static ScanResult globalError(Throwable throwable)
Create the scan result for situations where there is an exception executing the scan- Parameters:
throwable- the exception / error which occurred- Returns:
- the scan result
-
fileNotFound
public static ScanResult fileNotFound(ExecOptions execOptions, FileProtocol fileProtocol)
Generate a scan result for situations where the file is not found- Parameters:
execOptions- the exec optionsfileProtocol- the file protocol- Returns:
- the file not found scan result
-
fileNotFound
public static ScanResult fileNotFound(ExecOptions execOptions, String repositoryPath, String fileProtocolSeverity)
Generate a scan result for situations where the file is not found- Parameters:
execOptions- the exec optionsrepositoryPath- the repository pathfileProtocolSeverity- the file protocol severity- Returns:
- the file not found scan result
-
-