1 30 package org.apache.commons.httpclient.cookie; 31 32 40 public final class CookieOrigin { 41 42 private final String host; 43 private final int port; 44 private final String path; 45 private final boolean secure; 46 47 public CookieOrigin(final String host, int port, final String path, boolean secure) { 48 super(); 49 if (host == null) { 50 throw new IllegalArgumentException ( 51 "Host of origin may not be null"); 52 } 53 if (host.trim().equals("")) { 54 throw new IllegalArgumentException ( 55 "Host of origin may not be blank"); 56 } 57 if (port < 0) { 58 throw new IllegalArgumentException ("Invalid port: " + port); 59 } 60 if (path == null) { 61 throw new IllegalArgumentException ( 62 "Path of origin may not be null."); 63 } 64 this.host = host; 65 this.port = port; 66 this.path = path; 67 this.secure = secure; 68 } 69 70 public String getHost() { 71 return this.host; 72 } 73 74 public String getPath() { 75 return this.path; 76 } 77 78 public int getPort() { 79 return this.port; 80 } 81 82 public boolean isSecure() { 83 return this.secure; 84 } 85 86 } 87 | Popular Tags |