1 7 8 package java.net; 9 10 import java.io.IOException ; 11 import java.util.Map ; 12 import java.util.List ; 13 import sun.security.util.SecurityConstants; 14 15 44 public abstract class ResponseCache { 45 46 53 private static ResponseCache theResponseCache; 54 55 66 public synchronized static ResponseCache getDefault() { 67 SecurityManager sm = System.getSecurityManager(); 68 if (sm != null) { 69 sm.checkPermission(SecurityConstants.GET_RESPONSECACHE_PERMISSION); 70 } 71 return theResponseCache; 72 } 73 74 89 public synchronized static void setDefault(ResponseCache responseCache) { 90 SecurityManager sm = System.getSecurityManager(); 91 if (sm != null) { 92 sm.checkPermission(SecurityConstants.SET_RESPONSECACHE_PERMISSION); 93 } 94 theResponseCache = responseCache; 95 } 96 97 121 public abstract CacheResponse 122 get(URI uri, String rqstMethod, Map <String , List <String >> rqstHeaders) 123 throws IOException ; 124 125 145 public abstract CacheRequest put(URI uri, URLConnection conn) throws IOException ; 146 } 147 | Popular Tags |