@ Override public boolean update ( Engine engine ) throws UpdateException { this . settings = engine . getSettings ( ) ; String url = null ; try { final boolean autoupdate = settings . getBoolean ( Settings . KEYS . AUTO_UPDATE , true ) ; final boolean enabled = settings . getBoolean ( Settings . KEYS . ANALYZER_RETIREJS_ENABLED , true ) ; final File repoFile = new File ( settings . getDataDirectory ( ) , "jsrepository.json" ) ; final boolean proceed = enabled && autoupdate && shouldUpdagte ( repoFile ) ; if ( proceed ) { LOGGER . debug ( "Begin RetireJS Update" ) ; url = settings . getString ( Settings . KEYS . ANALYZER_RETIREJS_REPO_JS_URL , DEFAULT_JS_URL ) ; initializeRetireJsRepo ( settings , new URL ( url ) ) ; } } catch ( InvalidSettingException ex ) { throw new UpdateException ( "Unable to determine if autoupdate is enabled" , ex ) ; } catch ( MalformedURLException ex ) { throw new UpdateException ( String . format ( "Inavlid URL for RetireJS repository (%s)" , url ) , ex ) ; } catch ( IOException ex ) { throw new UpdateException ( "Unable to get the data directory" , ex ) ; } return false ; }
Downloads the current RetireJS data source .