Class RetireJSDataSource

java.lang.Object
org.owasp.dependencycheck.data.update.LocalDataSource
org.owasp.dependencycheck.data.update.RetireJSDataSource
All Implemented Interfaces:
CachedWebDataSource

@ThreadSafe public class RetireJSDataSource extends LocalDataSource
Downloads a local copy of the RetireJS repository.
Author:
Jeremy Long
  • Field Details

    • RETIREJS_UPDATED_ON

      public static final String RETIREJS_UPDATED_ON
      The property key indicating when the last update occurred.
      See Also:
    • DEFAULT_JS_URL

      public static final String DEFAULT_JS_URL
      The default URL to the RetireJS JavaScript repository.
      See Also:
  • Constructor Details

    • RetireJSDataSource

      public RetireJSDataSource()
      Constructs a new engine version check utility.
  • Method Details

    • update

      public boolean update(Engine engine) throws UpdateException
      Downloads the current RetireJS data source.
      Parameters:
      engine - a reference to the ODC Engine
      Returns:
      returns false as no updates are made to the database
      Throws:
      UpdateException - thrown if the update failed
    • shouldUpdate

      protected boolean shouldUpdate(File repo) throws NumberFormatException
      Determines if the we should update the RetireJS database.
      Parameters:
      repo - the retire JS repository.
      Returns:
      true if an updated to the RetireJS database should be performed; otherwise false
      Throws:
      NumberFormatException - thrown if an invalid value is contained in the database properties
    • purge

      public boolean purge(Engine engine)
      Description copied from interface: CachedWebDataSource
      Deletes any locally cached data.
      Parameters:
      engine - a reference to the dependency-check engine
      Returns:
      true if the purge was successful; otherwise false