public class URISupport extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
URISupport.CompositeData
A composite URI can be split into one or more CompositeData object which each represent
the individual URIs that comprise the composite one.
|
| Constructor and Description |
|---|
URISupport() |
| Modifier and Type | Method and Description |
|---|---|
static URI |
applyParameters(URI uri,
Map<String,String> queryParameters)
Given a Key / Value mapping create and append a URI query value that represents the
mapped entries, return the newly updated URI that contains the value of the given URI and
the appended query value.
|
static URI |
applyParameters(URI uri,
Map<String,String> queryParameters,
String optionPrefix)
Given a Key / Value mapping create and append a URI query value that represents the
mapped entries, return the newly updated URI that contains the value of the given URI and
the appended query value.
|
static boolean |
checkParenthesis(String str)
Examine the supplied string and ensure that all parends appear as matching pairs.
|
static int |
indexOfParenthesisMatch(String str,
int first)
Given a string and a position in that string of an open parend, find the matching close
parend.
|
static boolean |
isCompositeURI(URI uri)
Examine a URI and determine if it is a Composite type or not.
|
static URISupport.CompositeData |
parseComposite(URI uri)
Given a composite URI, parse the individual URI elements contained within that URI and
return a CompsoteData instance that contains the parsed URI values.
|
static Map<String,String> |
parseParameters(URI uri)
Given a URI parse and extract any URI query options and return them as a Key / Value
mapping.
|
static URI |
removeQuery(URI uri)
Removes any URI query from the given uri and return a new URI that does not contain the
query portion.
|
static String[] |
splitComponents(String str)
Given the inner portion of a composite URI, split and return each inner URI as a string
element in a new String array.
|
public static URISupport.CompositeData parseComposite(URI uri) throws URISyntaxException
uri - The target URI that should be parsed.URISyntaxException - if the given URI is invalid.public static boolean isCompositeURI(URI uri)
uri - The URI that is to be examined.public static boolean checkParenthesis(String str)
str - The target string to examine.public static int indexOfParenthesisMatch(String str, int first) throws URISyntaxException
str - The string to be searched for a matching parend.first - The index in the string of the opening parend whose close value is to be searched.URISyntaxException - if the string does not contain a matching parend.public static String[] splitComponents(String str)
str - The inner URI elements of a composite URI string.public static URI removeQuery(URI uri) throws URISyntaxException
uri - The URI whose query value is to be removed.URISyntaxException - if the given URI is invalid.public static Map<String,String> parseParameters(URI uri) throws URISyntaxException
uri - The URI whose query should be extracted and processed.URISyntaxException - if the given URI is invalid.public static URI applyParameters(URI uri, Map<String,String> queryParameters) throws URISyntaxException
uri - The source URI that will have the Map entries appended as a URI query value.queryParameters - The Key / Value mapping that will be transformed into a URI query string.URISyntaxException - if the given URI is invalid.public static URI applyParameters(URI uri, Map<String,String> queryParameters, String optionPrefix) throws URISyntaxException
This method replaces the value of any matching query string options in the original URI with the value given in the provided query parameters map.
uri - The source URI that will have the Map entries appended as a URI query value.queryParameters - The Key / Value mapping that will be transformed into a URI query string.optionPrefix - A string value that when not null or empty is used to prefix each query option
key.URISyntaxException - if the given URI is invalid.Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.