public final class UrlUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
authoritySafePath(String authority,
String path)
Returns a path that can be safely concatenated with
authority. |
static String |
canonicalizePath(String path,
boolean discardRelativePrefix)
Returns the path will relative path segments like ".." and "." resolved.
|
static int |
findFirstOf(String string,
String chars,
int start,
int end)
Returns the index of the first char of
chars in string
bounded between start and end. |
static String |
getSchemePrefix(String spec)
Returns the scheme prefix like "http" from the URL spec, or null if the
spec doesn't start with a scheme.
|
static boolean |
isValidSchemeChar(int index,
char c) |
public static String canonicalizePath(String path, boolean discardRelativePrefix)
discardRelativePrefix - true to remove leading ".." segments from
the path. This is appropriate for paths that are known to be
absolute.public static String authoritySafePath(String authority, String path)
authority. If
the authority is null or empty, this can be any path. Otherwise the paths
run together like http://android.comindex.html.public static String getSchemePrefix(String spec)
alpha ( alpha | digit | '+' | '-' | '.' )* ':'public static boolean isValidSchemeChar(int index,
char c)