URL (Java SE 23 & JDK 23)
-
Constructor Summary
Constructors
-
Method Summary
booleanCompares this URL for equality with another object.
Gets the authority part of this
URL.Gets the contents of this URL.
Gets the contents of this URL.
intGets the default port number of the protocol associated with this
URL.getFile()Gets the file name of this
URL.getHost()Gets the host name of this
URL, if applicable.getPath()Gets the path part of this
URL.intgetPort()Gets the port number of this
URL.Gets the protocol name of this
URL.getQuery()Gets the query part of this
URL.getRef()Gets the anchor (also known as the "reference") of this
URL.Gets the userInfo part of this
URL.inthashCode()Creates an integer suitable for hash table indexing.
Creates a URL from a URI, as if by invoking
uri.toURL(), but associating it with the givenURLStreamHandler, if allowed.Returns a
URLConnectioninstance that represents a connection to the remote object referred to by theURL.Same as
openConnection(), except that the connection will be made through the specified proxy; Protocol handlers that do not support proxying will ignore the proxy parameter and make a normal connection.Opens a connection to this
URLand returns anInputStreamfor reading from that connection.booleanCompares two URLs, excluding the fragment component.
static voidSets an application's
URLStreamHandlerFactory.Constructs a string representation of this
URL.toString()Constructs a string representation of this
URL.toURI()Returns a
URIequivalent to this URL.
-
Constructor Details
-
URL
-
URL
-
URL
-
URL
-
URL
-
URL
-
-
Method Details
-
of
-
getQuery
-
getPath
-
getUserInfo
-
getAuthority
-
getPort
-
getDefaultPort
-
getProtocol
-
getHost
-
getFile
-
getRef
-
equals
-
hashCode
-
sameFile
-
toString
-
toExternalForm
-
toURI
-
openConnection
-
openConnection
-
openStream
-
getContent
-
getContent
-
setURLStreamHandlerFactory
-