Class NexusAnalyzer

All Implemented Interfaces:
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:
Author:
colezlaw
  • Field Details

    • DEFAULT_URL

      public static final String DEFAULT_URL
      The default URL - this will be used by the CentralAnalyzer to determine whether to enable this.
      See Also:
  • Constructor Details

    • NexusAnalyzer

      public NexusAnalyzer()
  • Method Details

    • initialize

      public void initialize(Settings settings)
      Initializes the analyzer with the configured settings.
      Specified by:
      initialize in interface Analyzer
      Overrides:
      initialize in class AbstractAnalyzer
      Parameters:
      settings - the configured settings to use
    • isEnabled

      public boolean isEnabled()
      Determine whether to enable this analyzer or not.
      Specified by:
      isEnabled in interface Analyzer
      Overrides:
      isEnabled in class AbstractAnalyzer
      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:
      prepareFileTypeAnalyzer in class AbstractFileTypeAnalyzer
      Parameters:
      engine - a reference to the dependency-check engine
      Throws:
      InitializationException - if there's an error during initialization
    • getName

      public String getName()
      Returns the analyzer's name.
      Returns:
      the name of the analyzer
    • getAnalyzerEnabledSettingKey

      protected String getAnalyzerEnabledSettingKey()
      Returns the key used in the properties file to reference the analyzer's enabled property.
      Specified by:
      getAnalyzerEnabledSettingKey in class AbstractAnalyzer
      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 FileFilter getFileFilter()
      Returns the FileFilter
      Specified by:
      getFileFilter in class AbstractFileTypeAnalyzer
      Returns:
      the FileFilter
    • analyzeDependency

      public void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException
      Performs the analysis.
      Specified by:
      analyzeDependency in class AbstractAnalyzer
      Parameters:
      dependency - the dependency to analyze
      engine - 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:
      true if a proxy should be used