public final class URIBuilder extends Object
URIEncoded.
Query Parameters needs to be URIEncoded before they are added.
All methods return a NEW instance of the URI builder, meaning you can create a ROOT uri builder and use it
to your heart's content, as the instance will never change.| Modifier and Type | Field and Description |
|---|---|
static AtomicReference<URISchemeDefaults> |
schemeDefaults |
| Modifier and Type | Method and Description |
|---|---|
URIBuilder |
addParameter(Parameter parameter)
Adds a new Parameter to the collection of parameters
|
URIBuilder |
addParameter(String name,
String value)
Adds a new Parameter to the collection of parameters
|
URIBuilder |
addParameters(List<Parameter> parameters)
Adds Parameters to the collection of parameters
|
URIBuilder |
addParameters(Map<String,List<String>> params) |
URIBuilder |
addPath(List<String> path)
Appends the path part to the URI.
|
URIBuilder |
addPath(String... path) |
URIBuilder |
addRawPath(String path)
Adds a raw path to the URI.
|
static URIBuilder |
empty()
Creates an empty URIBuilder.
|
URIBuilder |
fragment(String fragment)
Deprecated.
|
static URIBuilder |
fromURI(URI uri)
Constructs a new URIBuilder from the given URI
|
String |
getCurrentPath() |
List<String> |
getEncodedPath() |
String |
getFirstParameterValueByName(String name) |
String |
getFragment() |
String |
getHost() |
List<Parameter> |
getParameters() |
List<Parameter> |
getParametersByName(String name) |
List<String> |
getPath() |
int |
getPort() |
String |
getScheme() |
URIBuilder |
host(String host)
Deprecated.
|
boolean |
isRelative() |
URIBuilder |
noParameters()
Creates a new URIBuilder with no parameters, but all other values retained.
|
URIBuilder |
parameters(List<Parameter> parameters)
Deprecated.
use #withParameters instead
|
URIBuilder |
path(List<String> pathList)
Deprecated.
|
URIBuilder |
path(String... path)
Deprecated.
|
URIBuilder |
port(int port)
Deprecated.
|
URIBuilder |
rawPath(String path)
Deprecated.
|
URIBuilder |
removeParameters(String name) |
URIBuilder |
replaceParameter(String name,
String value) |
URIBuilder |
scheme(String scheme)
Deprecated.
|
URI |
toAbsoluteURI() |
URI |
toNormalizedURI() |
URI |
toNormalizedURI(boolean encodePath) |
static Map<String,List<String>> |
toQueryMap(String query) |
URI |
toURI() |
URIBuilder |
withFragment(String fragment) |
URIBuilder |
withHost(String host) |
URIBuilder |
withParameters(List<Parameter> parameters)
Sets a list of parameters.
|
URIBuilder |
withParameters(Map<String,List<String>> params) |
URIBuilder |
withPath(List<String> pathList)
Sets the path of the uri.
|
URIBuilder |
withPath(String... path) |
URIBuilder |
withPort(int port)
Sets the port.
|
URIBuilder |
withRawPath(String path) |
URIBuilder |
withScheme(String scheme)
This is the scheme to use.
|
public static AtomicReference<URISchemeDefaults> schemeDefaults
@Deprecated public URIBuilder scheme(String scheme)
scheme - the scheme@Deprecated public URIBuilder host(String host)
public URIBuilder withHost(String host)
@Deprecated public URIBuilder port(int port)
port - the port to setpublic URIBuilder withPort(int port)
port - the port to setpublic URIBuilder withScheme(String scheme)
scheme - the schemepublic URIBuilder addRawPath(String path)
path - a path which may contain '/'public URIBuilder addPath(List<String> path)
path - path elements.public URIBuilder addPath(String... path)
path - path elementsaddPath(java.util.List)@Deprecated public URIBuilder path(String... path)
path - path elements.path(java.util.List)public URIBuilder withPath(String... path)
path - path elements.path(java.util.List)@Deprecated public URIBuilder path(List<String> pathList)
pathList - path elements.public URIBuilder withPath(List<String> pathList)
pathList - path elements.@Deprecated public URIBuilder rawPath(String path)
path - path elements.path(java.util.List)public URIBuilder withRawPath(String path)
path - path elements.path(java.util.List)@Deprecated public URIBuilder fragment(String fragment)
public URIBuilder withFragment(String fragment)
public URIBuilder noParameters()
@Deprecated public URIBuilder parameters(List<Parameter> parameters)
parameters - the list of parameterspublic URIBuilder withParameters(List<Parameter> parameters)
parameters - the list of parameterspublic URIBuilder withParameters(Map<String,List<String>> params)
public URIBuilder addParameter(String name, String value)
name - the parameter namevalue - the parameter valuepublic URIBuilder addParameter(Parameter parameter)
parameter - the parameterpublic URIBuilder addParameters(List<Parameter> parameters)
public URIBuilder addParameters(Map<String,List<String>> params)
public URIBuilder removeParameters(String name)
public URIBuilder replaceParameter(String name, String value)
public URI toURI()
public URI toNormalizedURI(boolean encodePath)
public URI toNormalizedURI()
public boolean isRelative()
public URI toAbsoluteURI()
public static URIBuilder fromURI(URI uri)
uri - the uri to usepublic static URIBuilder empty()
toURI() ()} will return "".public String getScheme()
public String getHost()
public int getPort()
public String getCurrentPath()
public String getFragment()
Copyright © 2008-2013. All Rights Reserved.