/** * Write a description of class UrlTest here. * * @author (your name) * @version (a version number or a date) */ import java.net.*; import java.io.*; public class UrlTest { public static void main(String arg[]) { try { URL url = new URL("http://google.com"); URLConnection conn = url.openConnection(); for (int i=0; ; i++) { String headerName = conn.getHeaderFieldKey(i); String headerValue = conn.getHeaderField(i); if (headerName == null && headerValue == null) { break; } if ("Set-Cookie".equalsIgnoreCase(headerName)) { String[] fields = headerValue.split(";\\s*"); String cookieValue = fields[0]; String expires = null; String path = null; String domain = null; boolean secure = false; for (int j=1; j