| java.lang.Object com.gargoylesoftware.htmlunit.util.UrlUtils
UrlUtils | final public class UrlUtils (Code) | | URL utilities class that makes it easy to create new URLs based off of old URLs
without having to assemble or parse them yourself.
version: $Revision: 2132 $ author: Daniel Gredler |
Method Summary | |
public static URL | getUrlWithNewHost(URL u, String newHost) Creates and returns a new URL identical to the specified URL, except using the specified host.
Parameters: u - The URL on which to base the returned URL. Parameters: newHost - The new host to use in the returned URL. | public static URL | getUrlWithNewPath(URL u, String newPath) Creates and returns a new URL identical to the specified URL, except using the specified path.
Parameters: u - The URL on which to base the returned URL. Parameters: newPath - The new path to use in the returned URL. | public static URL | getUrlWithNewPort(URL u, int newPort) Creates and returns a new URL identical to the specified URL, except using the specified port.
Parameters: u - The URL on which to base the returned URL. Parameters: newPort - The new port to use in the returned URL. | public static URL | getUrlWithNewProtocol(URL u, String newProtocol) Creates and returns a new URL identical to the specified URL, except using the specified protocol.
Parameters: u - The URL on which to base the returned URL. Parameters: newProtocol - The new protocol to use in the returned URL. | public static URL | getUrlWithNewQuery(URL u, String newQuery) Creates and returns a new URL identical to the specified URL, except using the specified query string.
Parameters: u - The URL on which to base the returned URL. Parameters: newQuery - The new query string to use in the returned URL. | public static URL | getUrlWithNewRef(URL u, String newRef) Creates and returns a new URL identical to the specified URL, except using the specified reference.
Parameters: u - The URL on which to base the returned URL. Parameters: newRef - The new reference to use in the returned URL. |
getUrlWithNewHost | public static URL getUrlWithNewHost(URL u, String newHost) throws MalformedURLException(Code) | | Creates and returns a new URL identical to the specified URL, except using the specified host.
Parameters: u - The URL on which to base the returned URL. Parameters: newHost - The new host to use in the returned URL. A new URL identical to the specified URL, except using the specified host. throws: MalformedURLException - If there is a problem creating the new URL. |
getUrlWithNewPath | public static URL getUrlWithNewPath(URL u, String newPath) throws MalformedURLException(Code) | | Creates and returns a new URL identical to the specified URL, except using the specified path.
Parameters: u - The URL on which to base the returned URL. Parameters: newPath - The new path to use in the returned URL. A new URL identical to the specified URL, except using the specified path. throws: MalformedURLException - If there is a problem creating the new URL. |
getUrlWithNewPort | public static URL getUrlWithNewPort(URL u, int newPort) throws MalformedURLException(Code) | | Creates and returns a new URL identical to the specified URL, except using the specified port.
Parameters: u - The URL on which to base the returned URL. Parameters: newPort - The new port to use in the returned URL. A new URL identical to the specified URL, except using the specified port. throws: MalformedURLException - If there is a problem creating the new URL. |
getUrlWithNewProtocol | public static URL getUrlWithNewProtocol(URL u, String newProtocol) throws MalformedURLException(Code) | | Creates and returns a new URL identical to the specified URL, except using the specified protocol.
Parameters: u - The URL on which to base the returned URL. Parameters: newProtocol - The new protocol to use in the returned URL. A new URL identical to the specified URL, except using the specified protocol. throws: MalformedURLException - If there is a problem creating the new URL. |
getUrlWithNewQuery | public static URL getUrlWithNewQuery(URL u, String newQuery) throws MalformedURLException(Code) | | Creates and returns a new URL identical to the specified URL, except using the specified query string.
Parameters: u - The URL on which to base the returned URL. Parameters: newQuery - The new query string to use in the returned URL. A new URL identical to the specified URL, except using the specified query string. throws: MalformedURLException - If there is a problem creating the new URL. |
getUrlWithNewRef | public static URL getUrlWithNewRef(URL u, String newRef) throws MalformedURLException(Code) | | Creates and returns a new URL identical to the specified URL, except using the specified reference.
Parameters: u - The URL on which to base the returned URL. Parameters: newRef - The new reference to use in the returned URL. A new URL identical to the specified URL, except using the specified reference. throws: MalformedURLException - If there is a problem creating the new URL. |
|
|