1 7 8 package java.net; 9 10 import java.util.Map ; 11 import java.util.List ; 12 import java.io.IOException ; 13 import sun.security.util.SecurityConstants; 14 15 35 public abstract class CookieHandler { 36 43 private static CookieHandler cookieHandler; 44 45 55 public synchronized static CookieHandler getDefault() { 56 SecurityManager sm = System.getSecurityManager(); 57 if (sm != null) { 58 sm.checkPermission(SecurityConstants.GET_COOKIEHANDLER_PERMISSION); 59 } 60 return cookieHandler; 61 } 62 63 75 public synchronized static void setDefault(CookieHandler cHandler) { 76 SecurityManager sm = System.getSecurityManager(); 77 if (sm != null) { 78 sm.checkPermission(SecurityConstants.SET_COOKIEHANDLER_PERMISSION); 79 } 80 cookieHandler = cHandler; 81 } 82 83 103 public abstract Map <String , List <String >> 104 get(URI uri, Map <String , List <String >> requestHeaders) 105 throws IOException ; 106 107 120 public abstract void 121 put(URI uri, Map <String , List <String >> responseHeaders) 122 throws IOException ; 123 } 124 | Popular Tags |