1 19 20 package com.sslexplorer.replacementproxy; 21 22 import java.io.File ; 23 import java.util.Iterator ; 24 import java.util.Map ; 25 26 import org.apache.commons.cache.CachedObjectInfo; 27 import org.apache.commons.cache.FileStash; 28 29 35 36 public class ContentStash extends FileStash { 37 38 public ContentStash() { 39 super(); 40 } 41 42 public ContentStash(long arg0) { 43 super(arg0); 44 } 45 46 public ContentStash(long arg0, long arg1) { 47 super(arg0, arg1); 48 } 49 50 public ContentStash(long arg0, long arg1, File arg2, int arg3) { 51 super(arg0, arg1, arg2, arg3); 52 } 53 54 public ContentStash(long arg0, long arg1, File arg2, int arg3, boolean arg4) { 55 super(arg0, arg1, arg2, arg3, arg4); 56 } 57 58 public ContentStash(long arg0, long arg1, File [] arg2, boolean arg3) { 59 super(arg0, arg1, arg2, arg3); 60 } 61 62 public ContentStash(long arg0, long arg1, String arg2, int arg3) { 63 super(arg0, arg1, arg2, arg3); 64 } 65 66 public ContentStash(long arg0, long arg1, String arg2, int arg3, boolean arg4) { 67 super(arg0, arg1, arg2, arg3, arg4); 68 } 69 70 75 public synchronized void clear() { 76 Iterator it = _hash.entrySet().iterator(); 77 while (it.hasNext()) { 78 try { 79 Map.Entry en = (Map.Entry ) it.next(); 80 CachedObjectInfo obj = (CachedObjectInfo) en.getValue(); 81 ((File ) (obj.getKey())).delete(); 82 } catch (Exception e) { 83 } 85 } 86 _hash.clear(); 87 _curBytes = 0; 88 } 89 90 } 91 | Popular Tags |