public class URL extends Object
URL making it almost into a "drop in" replacement.
It is placed in a different package because it is incompatible to URL by definition. It is useful
in getting some simple code to work without too many changes| Modifier and Type | Class and Description |
|---|---|
class |
URL.HttpURLConnection |
class |
URL.URLConnection |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
String |
getAuthority() |
int |
getDefaultPort() |
String |
getFile() |
String |
getHost() |
String |
getPath() |
int |
getPort() |
String |
getProtocol() |
String |
getQuery() |
String |
getUserInfo() |
int |
hashCode()
Returns a hash code value for the object.
|
URL.URLConnection |
openConnection() |
InputStream |
openStream() |
boolean |
sameFile(URL u) |
String |
toExternalForm() |
String |
toString()
Returns a string representation of the object.
|
URI |
toURI() |
public URL(String url) throws URISyntaxException
URISyntaxExceptionpublic String getQuery()
public String getPath()
public String getUserInfo()
public String getAuthority()
public int getPort()
public int getDefaultPort()
public String getProtocol()
public String getHost()
public String getFile()
public boolean equals(Object o)
Objectpublic int hashCode()
Objectpublic boolean sameFile(URL u)
public String toString()
Objectpublic String toExternalForm()
public URI toURI() throws URISyntaxException
URISyntaxExceptionpublic URL.URLConnection openConnection() throws IOException
IOExceptionpublic final InputStream openStream() throws IOException
IOException