List of usage examples for java.net URL URL
public URL(String spec) throws MalformedURLException
From source file:Main.java
public static void main(String args[]) throws Exception { URL url = new URL("http://www.google.com"); URLConnection httpCon = (URLConnection) url.openConnection(); int s = httpCon.getHeaderFieldInt("intKey", 1); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL url = new URL("http://www.google.com"); URLConnection httpCon = (URLConnection) url.openConnection(); long s = httpCon.getHeaderFieldLong("longKey", 1L); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL url = new URL("http://www.google.com"); URLConnection httpCon = (URLConnection) url.openConnection(); System.out.println(URLConnection.guessContentTypeFromStream(httpCon.getInputStream())); }
From source file:Main.java
public static void main(String[] argv) throws Exception { URL url = new URL("jar:file:/c://my.jar!/"); JarURLConnection conn = (JarURLConnection) url.openConnection(); String entryName = conn.getEntryName(); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getRequestProperties()); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getPermission()); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL url = new URL("http://www.google.com"); URLConnection httpCon = (URLConnection) url.openConnection(); long s = httpCon.getHeaderFieldDate("Date", 10000); System.out.println(s);/*from w w w. j a v a2s .co m*/ }
From source file:Main.java
public static void main(String[] argv) throws Exception { URL relativeURL, baseURL;/*from w w w . j a v a 2 s . com*/ baseURL = new URL("http://www.yourserver.com/"); relativeURL = new URL(baseURL, "./a.htm"); System.out.println(relativeURL.sameFile(baseURL)); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getContentLengthLong()); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getUseCaches()); }