|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.util.UrlUtils
public final class UrlUtils
URL utilities class that makes it easy to create new URLs based off of old URLs without having to assemble or parse them yourself.
Method Summary | |
---|---|
static java.net.URL |
getUrlWithNewHost(java.net.URL u,
java.lang.String newHost)
Creates and returns a new URL identical to the specified URL, except using the specified host. |
static java.net.URL |
getUrlWithNewPath(java.net.URL u,
java.lang.String newPath)
Creates and returns a new URL identical to the specified URL, except using the specified path. |
static java.net.URL |
getUrlWithNewPort(java.net.URL u,
int newPort)
Creates and returns a new URL identical to the specified URL, except using the specified port. |
static java.net.URL |
getUrlWithNewProtocol(java.net.URL u,
java.lang.String newProtocol)
Creates and returns a new URL identical to the specified URL, except using the specified protocol. |
static java.net.URL |
getUrlWithNewQuery(java.net.URL u,
java.lang.String newQuery)
Creates and returns a new URL identical to the specified URL, except using the specified query string. |
static java.net.URL |
getUrlWithNewRef(java.net.URL u,
java.lang.String newRef)
Creates and returns a new URL identical to the specified URL, except using the specified reference. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.net.URL getUrlWithNewHost(java.net.URL u, java.lang.String newHost) throws java.net.MalformedURLException
u
- The URL on which to base the returned URL.newHost
- The new host to use in the returned URL.
java.net.MalformedURLException
- If there is a problem creating the new URL.public static java.net.URL getUrlWithNewPath(java.net.URL u, java.lang.String newPath) throws java.net.MalformedURLException
u
- The URL on which to base the returned URL.newPath
- The new path to use in the returned URL.
java.net.MalformedURLException
- If there is a problem creating the new URL.public static java.net.URL getUrlWithNewPort(java.net.URL u, int newPort) throws java.net.MalformedURLException
u
- The URL on which to base the returned URL.newPort
- The new port to use in the returned URL.
java.net.MalformedURLException
- If there is a problem creating the new URL.public static java.net.URL getUrlWithNewProtocol(java.net.URL u, java.lang.String newProtocol) throws java.net.MalformedURLException
u
- The URL on which to base the returned URL.newProtocol
- The new protocol to use in the returned URL.
java.net.MalformedURLException
- If there is a problem creating the new URL.public static java.net.URL getUrlWithNewQuery(java.net.URL u, java.lang.String newQuery) throws java.net.MalformedURLException
u
- The URL on which to base the returned URL.newQuery
- The new query string to use in the returned URL.
java.net.MalformedURLException
- If there is a problem creating the new URL.public static java.net.URL getUrlWithNewRef(java.net.URL u, java.lang.String newRef) throws java.net.MalformedURLException
u
- The URL on which to base the returned URL.newRef
- The new reference to use in the returned URL.
java.net.MalformedURLException
- If there is a problem creating the new URL.
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |