Constructors
Name | Description |
---|---|
URL(String) | Creates a URL object from the String representation. |
URL(String, String, int, String) | Creates a URL object from the specified protocol, host, port number, and file. |
URL(String, String, String) | Creates an absolute URL from the specified protocol name, host name, and file name. |
URL(URL, String) | Creates a URL by parsing the specification spec within a specified context. |
Methods
Name | Description |
---|---|
equals(Object) | Compares two URLs. |
getContent() | Returns the contents of this URL. |
getFile() | Returns the file name of this URL. |
getHost() | Returns the host name of this URL, if applicable. |
getPort() | Returns the port number of this URL. |
getProtocol() | Returns the protocol name this URL. |
getRef() | Returns the anchor (also known as the "reference") of this URL. |
hashCode() | Creates an integer suitable for hash table indexing. |
openConnection() | Returns a URLConnection object that represents a connection to the remote object referred to by the URL. |
openStream() | Opens a connection to this URL and returns an InputStream for reading from that connection. |
sameFile(URL) | Compares two URLs, excluding the "ref" fields. |
set(String, String, int, String, String) | Sets the fields of the URL. |
setURLStreamHandlerFactory(URLStreamHandlerFactory) | Sets an application's URLStreamHandlerFactory. |
toExternalForm() | Constructs a string representation of this URL. |
toString() | Constructs a string representation of this URL. |