Class RetireJSDataSource

  • All Implemented Interfaces:
    CachedWebDataSource

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

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_JS_URL
      The default URL to the RetireJS JavaScript repository.
      static java.lang.String RETIREJS_UPDATED_ON
      The property key indicating when the last update occurred.
    • Constructor Summary

      Constructors 
      Constructor Description
      RetireJSDataSource()
      Constructs a new engine version check utility.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean purge​(Engine engine)
      Deletes any locally cached data.
      protected boolean shouldUpdate​(java.io.File repo)
      Determines if the we should update the RetireJS database.
      boolean update​(Engine engine)
      Downloads the current RetireJS data source.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • RETIREJS_UPDATED_ON

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

        public static final java.lang.String DEFAULT_JS_URL
        The default URL to the RetireJS JavaScript repository.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RetireJSDataSource

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

      • 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​(java.io.File repo)
                                throws java.lang.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:
        java.lang.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