public enum Path extends Enum<Path>
| Modifier and Type | Method and Description |
|---|---|
static String |
fullUrl(String path)
Returns the full url form of a url path which starts with scheme.
|
static String |
fullUrl(String path,
boolean secure)
Return the full url form of a url path which starts with scheme.
|
static String |
fullUrl(String path,
H.Request req)
Returns the full url form of a url path which starts with scheme.
|
static boolean |
isAbsoluteUrl(String path)
Check if a path is absolute.
|
static boolean |
isFullUrl(String path)
Check if a path is full URL including scheme
|
static List<String> |
tokenize(char[] buf) |
static List<String> |
tokenize(char[] buf,
int start) |
static List<String> |
tokenize(char[] buf,
int start,
char separator,
char terminator) |
static Iterator<String> |
tokenizer(char[] buf) |
static Iterator<String> |
tokenizer(char[] buf,
int start) |
static Iterator<String> |
tokenizer(char[] buf,
int start,
char separator,
char terminator) |
static String |
url(String path)
Returns a normalized url for a path.
|
static String |
url(String path,
H.Request req)
Returns normalized form of URL path.
|
static Path |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Path[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static Path[] values()
for (Path c : Path.values()) System.out.println(c);
public static Path valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static boolean isFullUrl(String path)
Check if a path is full URL including scheme
path - the path to be checkedtrue if the path is full urlpublic static boolean isAbsoluteUrl(String path)
Check if a path is absolute. A path is considered to be absolute if it is full url or it starts with "//"
path - the path to be checkedtrue if the path is absolutepublic static String url(String path)
Returns a normalized url for a path. If the path is absolute then it is returned directly.
Otherwise the path is prepended with the
context path
path - the url path to be normalizedpublic static String url(String path, H.Request req)
Returns normalized form of URL path. If the path is absolute then it is returned directly
Otherwise the path is prepended with the
context info
If the request is null then
url(String) is called
path - the url path to be normalizedreq - the request instancepublic static String fullUrl(String path)
Returns the full url form of a url path which starts with scheme. The scheme, domain, port, context path info are get from HttpConfig
path - the url pathpublic static String fullUrl(String path, boolean secure)
Return the full url form of a url path which starts with scheme. The domain, port and context path info are get from HttpConfig
path - the path to be normalizedsecure - is the full url needs to be secure or nopublic static String fullUrl(String path, H.Request req)
Returns the full url form of a url path which starts with scheme. the domain, port and context path info are get from the H.Request specified. If the request is null then it will call back fullUrl(String, boolean) with secure be set to false.
path - the path to be normalizedreq - the http request from which the domain, port and context path are fetchedpublic static Iterator<String> tokenizer(char[] buf, int start, char separator, char terminator)
Copyright © 2017–2020 OSGL (Open Source General Library). All rights reserved.