public class URLBuilder extends Object
Constructor and Description |
---|
URLBuilder()
Constructor.
|
URLBuilder(String baseURL)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
buildQueryString()
Builds the query string for the URL.
|
String |
buildURL()
Builds a URL from the given data.
|
String |
getFragment()
Gets the URL fragment in its decoded form.
|
String |
getHost()
Gets the host component of the URL.
|
String |
getPassword()
Gets the user's password in the URL.
|
String |
getPath()
Gets the path component of the URL.
|
int |
getPort()
Gets the port component of the URL.
|
List<Pair<String,String>> |
getQueryParams()
Gets the query string parameters for the URL.
|
String |
getScheme()
Gets the URL scheme (http, https, etc).
|
String |
getUsername()
Gets the user name component of the URL.
|
void |
setFragment(String newFragment)
Sets the URL fragment in its decoded form.
|
void |
setHost(String newHost)
Sets the host component of the URL.
|
void |
setPassword(String newPassword)
Sets the user's password in the URL.
|
void |
setPath(String newPath)
Sets the path component of the URL.
|
void |
setPort(int newPort)
Sets the port component of the URL.
|
void |
setScheme(String newScheme)
Sets the URL scheme (http, https, etc).
|
void |
setUsername(String newUsername)
Sets the user name component of the URL.
|
public URLBuilder()
public URLBuilder(String baseURL)
baseURL
- URL to parse and use as basis for creating other URLsIllegalArgumentException
- thrown if the given base URL is not well formedpublic String getFragment()
public void setFragment(String newFragment)
newFragment
- URL fragment in its decoded formpublic String getHost()
public void setHost(String newHost)
newHost
- host component of the URLpublic String getPassword()
public void setPassword(String newPassword)
newPassword
- user's password in the URLpublic String getPath()
public void setPath(String newPath)
newPath
- path component of the URLpublic int getPort()
public void setPort(int newPort)
newPort
- port component of the URLpublic List<Pair<String,String>> getQueryParams()
public String getScheme()
public void setScheme(String newScheme)
newScheme
- URL scheme (http, https, etc)public String getUsername()
public void setUsername(String newUsername)
newUsername
- user name component of the URLpublic String buildURL()
public String buildQueryString()
Copyright © 2018 JBoss by Red Hat. All rights reserved.