Parse URL : URL : Network Protocol : Java examples (example source code) Organized by topic

Java
C++
PHP
Java Home »  Network Protocol   » [  URL  ]  Screenshots 
 



Parse URL



/* From http://java.sun.com/docs/books/tutorial/index.html */


import java.net.URL;

public class ParseURL {
  public static void main(String[] argsthrows Exception {
    URL aURL = new URL("http://java.sun.com:80/docs/books/"
        "tutorial/index.html#DOWNLOADING");
    System.out.println("protocol = " + aURL.getProtocol());
    System.out.println("host = " + aURL.getHost());
    System.out.println("filename = " + aURL.getFile());
    System.out.println("port = " + aURL.getPort());
    System.out.println("ref = " + aURL.getRef());
  }
}
           
       
Related examples in the same category
1.  URL Constructor Test
2.  URL Encode Test
3.  Get URL Content
4.  Get URL Parts
5.  Read from a URL
6.  URL Equality
7.  URL Request
8.  URL Get
9.  URL Reader
10.  URL Connection Reader URL Connection Reader
11.  URLConnection
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.