1 19 20 package com.sslexplorer.applications.server; 21 22 import java.io.File ; 23 import java.util.Enumeration ; 24 import java.util.Vector ; 25 26 30 public class ClientCacheRemover { 31 32 static ClientCacheRemover instance; 33 34 Vector files = new Vector (); 35 36 public static ClientCacheRemover getInstance() { 37 if(instance==null) 38 instance = new ClientCacheRemover(); 39 40 return instance; 41 } 42 43 public void trackFileForRemoval(File f) { 44 files.addElement(f); 45 } 46 47 public void cleanup() { 48 for(Enumeration e = files.elements(); e.hasMoreElements();){ 49 ((File )e.nextElement()).delete(); 50 } 51 52 files.removeAllElements(); 53 } 54 55 protected void finalize() { 56 cleanup(); 57 } 58 } 59 | Popular Tags |