private void persistNewTemp(File fileCfg){
  if (hsDeleteOnExit.size() == 0) {
    logDebug(LogArea.CONFIG,"No temp file names to persist on exit.");
    fileCfg.delete();
    return;
  }
  logDebug(LogArea.CONFIG,"Persisting %d temp file names into %s",hsDeleteOnExit.size(),fileCfg.getAbsolutePath());
  BufferedWriter writer=null;
  try {
    writer=new BufferedWriter(new FileWriter(fileCfg));
    for (    File file : hsDeleteOnExit) {
      if (!file.delete()) {
        String f=file.getCanonicalPath();
        writer.write(f);
        writer.newLine();
        logWarn(LogArea.JAR,"JVM failed to release %s",f);
      }
    }
  }
 catch (  IOException e) {
  }
 finally {
    if (writer != null) {
      try {
        writer.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

private void persistNewTemp ( File fileCfg ) { if ( hsDeleteOnExit . size ( ) == 0 ) { logDebug ( LogArea . CONFIG , "No temp file names to persist on exit." ) ; fileCfg . delete ( ) ; return ; } logDebug ( LogArea . CONFIG , "Persisting %d temp file names into %s" , hsDeleteOnExit . size ( ) , fileCfg . getAbsolutePath ( ) ) ; BufferedWriter writer = null ; try { writer = new BufferedWriter ( new FileWriter ( fileCfg ) ) ; for ( File file : hsDeleteOnExit ) { if ( ! file . delete ( ) ) { String f = file . getCanonicalPath ( ) ; writer . write ( f ) ; writer . newLine ( ) ; logWarn ( LogArea . JAR , "JVM failed to release %s" , f ) ; } } } catch ( IOException e ) { } finally { if ( writer != null ) { try { writer . close ( ) ; } catch ( IOException e ) { } } } }
creates file with temporary files list . this list will be used to delete temporary files on the next application launch . the method is called from shutdown ( ) .
