@ Override public void execute ( ) throws BuildException { populateSettings ( ) ; final File db ; try { db = new File ( getSettings ( ) . getDataDirectory ( ) , getSettings ( ) . getString ( Settings . KEYS . DB_FILE_NAME , "odc.mv.db" ) ) ; if ( db . exists ( ) ) { if ( db . delete ( ) ) { log ( "Database file purged; local copy of the NVD has been removed" , Project . MSG_INFO ) ; } else { final String msg = String . format ( "Unable to delete '%s'; please delete the file manually" , db . getAbsolutePath ( ) ) ; if ( this . failOnError ) { throw new BuildException ( msg ) ; } log ( msg , Project . MSG_ERR ) ; } } else { final String msg = String . format ( "Unable to purge database; the database file does not exist: %s" , db . getAbsolutePath ( ) ) ; if ( this . failOnError ) { throw new BuildException ( msg ) ; } log ( msg , Project . MSG_ERR ) ; } } catch ( IOException ex ) { final String msg = "Unable to delete the database" ; if ( this . failOnError ) { throw new BuildException ( msg ) ; } log ( msg , Project . MSG_ERR ) ; } finally { settings . cleanup ( true ) ; } }
Executes the dependency - check purge to delete the existing local copy of the NVD CVE data .