@ThreadSafe public final class URIUtils extends Object
Modifier and Type | Field and Description |
---|---|
static char |
QUERY_KEY_VALUE_SEPARATOR |
static char |
QUERY_SEPARATOR |
Modifier and Type | Method and Description |
---|---|
static URI |
appendPath(URI base,
String path)
Appends the given path to the given base URI.
|
static URI |
appendPathOrDie(URI base,
String path)
Appends the given path to the given base URI.
|
static int |
compare(String s1,
String s2) |
static boolean |
equals(String s1,
String s2)
Checks if two (nullable) strings are equal.
|
static String |
generateQueryString(Map<String,String> queryMap)
Generates a query string from a
Map of key/value pairs. |
static int |
hash(int hash,
String s)
Hashes a string for a URI hash.
|
static int |
hashIgnoreCase(int hash,
String s)
Hashes a string for a URI hash, while ignoring the case.
|
static boolean |
isLocalFilesystem(String uri) |
static boolean |
needsNormalization(String path)
Returns true if the path requires normalization.
|
static Map<String,String> |
parseQueryString(String query)
Parses the given query string, and returns a map of the query parameters.
|
static int |
toLower(char c) |
public static final char QUERY_SEPARATOR
public static final char QUERY_KEY_VALUE_SEPARATOR
public static URI appendPath(URI base, String path) throws URISyntaxException
base
- the base URIpath
- the path to appendURISyntaxException
- if URI syntax error is encounteredpublic static URI appendPathOrDie(URI base, String path)
RuntimeException
if
the inputs are malformed.base
- the base URIpath
- the path to append@Nullable public static String generateQueryString(Map<String,String> queryMap)
Map
of key/value pairs.queryMap
- the map of query key/value pairspublic static Map<String,String> parseQueryString(String query)
query
- the query string to parsepublic static boolean isLocalFilesystem(String uri)
uri
- a uri to checkpublic static int compare(String s1, String s2)
s1
- first string (can be null)s2
- second string (can be null)public static boolean equals(String s1, String s2)
s1
- the first string to compare (can be null)s2
- the second string to compare (can be null)public static int toLower(char c)
c
- the character to convertpublic static boolean needsNormalization(String path)
path
- path to checkpublic static int hash(int hash, String s)
hash
- the input hashs
- the string to hash and combine with the input hashpublic static int hashIgnoreCase(int hash, String s)
hash
- the input hashs
- the string to hash and combine with the input hashCopyright © 2023. All Rights Reserved.