|
||||||||||
| 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 URL |
getUrlWithNewHost(URL u,
String newHost)
Creates and returns a new URL identical to the specified URL, except using the specified host. |
static URL |
getUrlWithNewPath(URL u,
String newPath)
Creates and returns a new URL identical to the specified URL, except using the specified path. |
static URL |
getUrlWithNewPort(URL u,
int newPort)
Creates and returns a new URL identical to the specified URL, except using the specified port. |
static URL |
getUrlWithNewProtocol(URL u,
String newProtocol)
Creates and returns a new URL identical to the specified URL, except using the specified protocol. |
static URL |
getUrlWithNewQuery(URL u,
String newQuery)
Creates and returns a new URL identical to the specified URL, except using the specified query string. |
static URL |
getUrlWithNewRef(URL u,
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static URL getUrlWithNewProtocol(URL u,
String newProtocol)
throws MalformedURLException
u - The URL on which to base the returned URL.newProtocol - The new protocol to use in the returned URL.
MalformedURLException - If there is a problem creating the new URL.
public static URL getUrlWithNewHost(URL u,
String newHost)
throws MalformedURLException
u - The URL on which to base the returned URL.newHost - The new host to use in the returned URL.
MalformedURLException - If there is a problem creating the new URL.
public static URL getUrlWithNewPort(URL u,
int newPort)
throws MalformedURLException
u - The URL on which to base the returned URL.newPort - The new port to use in the returned URL.
MalformedURLException - If there is a problem creating the new URL.
public static URL getUrlWithNewPath(URL u,
String newPath)
throws MalformedURLException
u - The URL on which to base the returned URL.newPath - The new path to use in the returned URL.
MalformedURLException - If there is a problem creating the new URL.
public static URL getUrlWithNewRef(URL u,
String newRef)
throws MalformedURLException
u - The URL on which to base the returned URL.newRef - The new reference to use in the returned URL.
MalformedURLException - If there is a problem creating the new URL.
public static URL getUrlWithNewQuery(URL u,
String newQuery)
throws MalformedURLException
u - The URL on which to base the returned URL.newQuery - The new query string to use in the returned URL.
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 | |||||||||