Class NexusAnalyzer
- java.lang.Object
-
- org.owasp.dependencycheck.analyzer.AbstractAnalyzer
-
- org.owasp.dependencycheck.analyzer.AbstractFileTypeAnalyzer
-
- org.owasp.dependencycheck.analyzer.NexusAnalyzer
-
- All Implemented Interfaces:
java.io.FileFilter,Analyzer,FileTypeAnalyzer
@ThreadSafe public class NexusAnalyzer extends AbstractFileTypeAnalyzer
Analyzer which will attempt to locate a dependency on a Nexus service by SHA-1 digest of the dependency. There are two settings which govern this behavior:Settings.KEYS.ANALYZER_NEXUS_ENABLEDdetermines whether this analyzer is even enabled. This can be overridden by setting the system property.Settings.KEYS.ANALYZER_NEXUS_URLthe URL to a Nexus service to search by SHA-1. There is an expected%sin this where the SHA-1 will get entered.
- Author:
- colezlaw
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_URLThe default URL - this will be used by the CentralAnalyzer to determine whether to enable this.
-
Constructor Summary
Constructors Constructor Description NexusAnalyzer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidanalyzeDependency(Dependency dependency, Engine engine)Performs the analysis.AnalysisPhasegetAnalysisPhase()Returns the analysis phase under which the analyzer runs.protected java.lang.StringgetAnalyzerEnabledSettingKey()Returns the key used in the properties file to reference the analyzer's enabled property.protected java.io.FileFiltergetFileFilter()Returns the FileFilterjava.lang.StringgetName()Returns the analyzer's name.voidinitialize(Settings settings)Initializes the analyzer with the configured settings.booleanisEnabled()Determine whether to enable this analyzer or not.voidprepareFileTypeAnalyzer(Engine engine)Initializes the analyzer once before any analysis is performed.booleanuseProxy()Determine if a proxy should be used for the Nexus Analyzer.-
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, prepare, setEnabled, supportsParallelProcessing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.owasp.dependencycheck.analyzer.Analyzer
analyze, close, prepare, supportsParallelProcessing
-
-
-
-
Field Detail
-
DEFAULT_URL
public static final java.lang.String DEFAULT_URL
The default URL - this will be used by the CentralAnalyzer to determine whether to enable this.- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(Settings settings)
Initializes the analyzer with the configured settings.- Specified by:
initializein interfaceAnalyzer- Overrides:
initializein classAbstractAnalyzer- Parameters:
settings- the configured settings to use
-
isEnabled
public boolean isEnabled()
Determine whether to enable this analyzer or not.- Specified by:
isEnabledin interfaceAnalyzer- Overrides:
isEnabledin classAbstractAnalyzer- Returns:
- whether the analyzer should be enabled
-
prepareFileTypeAnalyzer
public void prepareFileTypeAnalyzer(Engine engine) throws InitializationException
Initializes the analyzer once before any analysis is performed.- Specified by:
prepareFileTypeAnalyzerin classAbstractFileTypeAnalyzer- Parameters:
engine- a reference to the dependency-check engine- Throws:
InitializationException- if there's an error during initialization
-
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 reference the analyzer's enabled property.- Specified by:
getAnalyzerEnabledSettingKeyin 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 this analyzer runs
-
getFileFilter
protected java.io.FileFilter getFileFilter()
Returns the FileFilter- Specified by:
getFileFilterin classAbstractFileTypeAnalyzer- Returns:
- the FileFilter
-
analyzeDependency
public void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException
Performs the analysis.- Specified by:
analyzeDependencyin classAbstractAnalyzer- Parameters:
dependency- the dependency to analyzeengine- the engine- Throws:
AnalysisException- when there's an exception during analysis
-
useProxy
public boolean useProxy()
Determine if a proxy should be used for the Nexus Analyzer.- Returns:
trueif a proxy should be used
-
-