示例#1
0
  /** Shutdown and cleanup the temporary directory and removes any shutdown hooks in use. */
  @Deprecated
  public static synchronized void shutdown() {
    if (defaultTempDir != null && defaultTempDir.exists()) {
      removeDir(defaultTempDir);
    }

    if (shutdownHook != null) {
      Runtime.getRuntime().removeShutdownHook(shutdownHook);
      shutdownHook = null;
    }
  }
示例#2
0
 public static void removeDir(File d) {
   String[] list = d.list();
   if (list == null) {
     list = new String[0];
   }
   for (String s : list) {
     File f = new File(d, s);
     if (f.isDirectory()) {
       removeDir(f);
     } else {
       delete(f);
     }
   }
   delete(d);
 }