1 7 8 package java.net; 9 10 21 public interface CookiePolicy { 22 25 public static final CookiePolicy ACCEPT_ALL = new CookiePolicy (){ 26 public boolean shouldAccept(URI uri, HttpCookie cookie) { 27 return true; 28 } 29 }; 30 31 34 public static final CookiePolicy ACCEPT_NONE = new CookiePolicy (){ 35 public boolean shouldAccept(URI uri, HttpCookie cookie) { 36 return false; 37 } 38 }; 39 40 43 public static final CookiePolicy ACCEPT_ORIGINAL_SERVER = new CookiePolicy (){ 44 public boolean shouldAccept(URI uri, HttpCookie cookie) { 45 return HttpCookie.domainMatches(cookie.getDomain(), uri.getHost()); 46 } 47 }; 48 49 50 58 public boolean shouldAccept(URI uri, HttpCookie cookie); 59 } 60 61 | Popular Tags |