Class ArtifactoryAnalyzer
- java.lang.Object
-
- org.owasp.dependencycheck.analyzer.AbstractAnalyzer
-
- org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer
-
- org.owasp.dependencycheck.analyzer.ArtifactoryAnalyzer
-
- All Implemented Interfaces:
java.io.FileFilter
,Analyzer
,FileTypeAnalyzer
@ThreadSafe public class ArtifactoryAnalyzer extends AbstractFileTypeAnalyzer
Analyzer which will attempt to locate a dependency, and the GAV information, by querying Artifactory for the dependency's hashes digest.- Author:
- nhenneaux
-
-
Constructor Summary
Constructors Constructor Description ArtifactoryAnalyzer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
analyzeDependency(Dependency dependency, Engine engine)
Performs the analysis.AnalysisPhase
getAnalysisPhase()
Returns the analysis phase under which the analyzer runs.protected java.lang.String
getAnalyzerEnabledSettingKey()
Returns the key used in the properties file to to reference the analyzer's enabled property.protected java.io.FileFilter
getFileFilter()
Returns theFileFilter
used to determine which files are to be analyzed.java.lang.String
getName()
Returns the analyzer's name.void
initialize(Settings settings)
Initializes the analyzer with the configured settings.void
prepareFileTypeAnalyzer(Engine engine)
Initializes the analyzer once before any analysis is performed.boolean
supportsParallelProcessing()
Whether the analyzer is configured to support parallel processing.-
Methods inherited from class org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer
accept, getFilesMatched, newHashSet, prepareAnalyzer, setFilesMatched
-
Methods inherited from class org.owasp.dependencycheck.analyzer.AbstractAnalyzer
analyze, close, closeAnalyzer, getSettings, isEnabled, prepare, setEnabled
-
-
-
-
Method Detail
-
initialize
public void initialize(Settings settings)
Initializes the analyzer with the configured settings.- Specified by:
initialize
in interfaceAnalyzer
- Overrides:
initialize
in classAbstractAnalyzer
- Parameters:
settings
- the configured settings to use
-
supportsParallelProcessing
public boolean supportsParallelProcessing()
Whether the analyzer is configured to support parallel processing.- Specified by:
supportsParallelProcessing
in interfaceAnalyzer
- Overrides:
supportsParallelProcessing
in classAbstractAnalyzer
- Returns:
- true if configured to support parallel processing; otherwise false
-
prepareFileTypeAnalyzer
public void prepareFileTypeAnalyzer(Engine engine) throws InitializationException
Initializes the analyzer once before any analysis is performed.- Specified by:
prepareFileTypeAnalyzer
in classAbstractFileTypeAnalyzer
- Parameters:
engine
- a reference to the dependency-check engine- Throws:
InitializationException
- thrown when the analyzer is unable to connect to Artifactory
-
getName
public java.lang.String getName()
Returns the analyzer's name.- Returns:
- the name of the analyzer
-
getAnalyzerEnabledSettingKey
protected java.lang.String getAnalyzerEnabledSettingKey()
Returns the key used in the properties file to to reference the analyzer's enabled property.- Specified by:
getAnalyzerEnabledSettingKey
in classAbstractAnalyzer
- Returns:
- the analyzer's enabled property setting key.
-
getAnalysisPhase
public AnalysisPhase getAnalysisPhase()
Returns the analysis phase under which the analyzer runs.- Returns:
- the phase under which the analyzer runs
-
getFileFilter
protected java.io.FileFilter getFileFilter()
Description copied from class:AbstractFileTypeAnalyzer
Returns the
FileFilter
used to determine which files are to be analyzed. An example would be an analyzer that inspected Java jar files. Implementors may useFileFilterBuilder
.If the analyzer returns null it will not cause additional files to be analyzed, but will be executed against every file loaded.
- Specified by:
getFileFilter
in classAbstractFileTypeAnalyzer
- Returns:
- the file filter used to determine which files are to be analyzed
-
analyzeDependency
public void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException
Performs the analysis.- Specified by:
analyzeDependency
in classAbstractAnalyzer
- Parameters:
dependency
- the dependency to analyzeengine
- the engine- Throws:
AnalysisException
- when there's an exception during analysis
-
-