The URL class provides utility methods that let you query URL objects. You can get the protocol, authority, host name, port number, path, query, filename, and reference from a URL using these accessor methods:
getProtocol() method returns the protocol identifier of the URL.
getAuthority() method returns the authority of the URL.
getHost() method returns the host name of the URL.
getPort() method returns the port number of the URL. If the port is not set, then it returns -1.
getPath() method returns the path of this URL.
getQuery() method returns the query of this URL.
getFile() method returns the filename of the URL.
getRef() method returns the reference of the URL.
Code
getProtocol() method returns the protocol identifier of the URL.
getAuthority() method returns the authority of the URL.
getHost() method returns the host name of the URL.
getPort() method returns the port number of the URL. If the port is not set, then it returns -1.
getPath() method returns the path of this URL.
getQuery() method returns the query of this URL.
getFile() method returns the filename of the URL.
getRef() method returns the reference of the URL.
Code
No comments:
Post a Comment