What is URL? URL represents Uniform Resource Locator. It's a pointer to a "resource" on the WorldWide Web.
A resource can be something as simple as a file or a directory,or it can be a reference to a more complicated object,such as a query to a database or to a search engine.
A URL can optionally specify a "port", which is the port number to which the TCP connection is made on the remote host machine. If the port is not specified, the default port for the protocol is used instead. For example, the default port for http is 80.
Java Class java.net.URL provides number of methods such as getFile(),getHost(),getQuery() etc to deal with URL. Please refer to J2SE 6 Documentation for URL Class.
Here I will show you how You can retrieve different parts of URL using Java Program.
A resource can be something as simple as a file or a directory,or it can be a reference to a more complicated object,such as a query to a database or to a search engine.
A URL can optionally specify a "port", which is the port number to which the TCP connection is made on the remote host machine. If the port is not specified, the default port for the protocol is used instead. For example, the default port for http is 80.
Java Class java.net.URL provides number of methods such as getFile(),getHost(),getQuery() etc to deal with URL. Please refer to J2SE 6 Documentation for URL Class.
Here I will show you how You can retrieve different parts of URL using Java Program.