public final class TachyonURI extends Object implements Comparable<TachyonURI>
| Modifier and Type | Field and Description |
|---|---|
static String |
CUR_DIR |
static TachyonURI |
EMPTY_URI |
static String |
SEPARATOR |
static String |
WILDCARD |
| Constructor and Description |
|---|
TachyonURI(String pathStr)
Construct a TachyonURI from a String.
|
TachyonURI(String scheme,
String authority,
String path)
Construct a TachyonURI from components.
|
TachyonURI(TachyonURI parent,
TachyonURI child)
Resolve a child TachyonURI against a parent TachyonURI.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(TachyonURI other) |
boolean |
containsWildcard()
Whether or not the TachyonURI contains wildcard(s).
|
boolean |
equals(Object o) |
String |
getAuthority()
Gets the authority of the TachyonURI.
|
int |
getDepth()
Return the number of elements of the path component of the TachyonURI.
|
String |
getHost()
Gets the host of the TachyonURI.
|
String |
getLeadingPath(int n)
Get the first n components of the TachyonURI path.
|
String |
getName()
Get the final component of the TachyonURI.
|
TachyonURI |
getParent()
Get the parent of this TachyonURI or null if at root.
|
String |
getPath()
Gets the path component of the TachyonURI.
|
int |
getPort()
Gets the port of the TachyonURI.
|
String |
getScheme()
Get the scheme of the TachyonURI.
|
boolean |
hasAuthority()
Tells if the TachyonURI has authority or not.
|
int |
hashCode() |
boolean |
hasScheme()
Tells if this TachyonURI has scheme or not.
|
boolean |
isAbsolute()
Tells whether or not the TachyonURI is absolute.
|
boolean |
isPathAbsolute()
Tells whether or not the path component of the TachyonURI is absolute.
|
boolean |
isRoot()
Tells whether or not the TachyonURI is root.
|
TachyonURI |
join(String suffix)
Append additional path elements to the end of a TachyonURI.
|
TachyonURI |
join(TachyonURI suffix)
Append additional path elements to the end of a TachyonURI.
|
String |
toString()
Illegal characters unescaped in the string, for glob processing, etc.
|
public static final String SEPARATOR
public static final String CUR_DIR
public static final String WILDCARD
public static final TachyonURI EMPTY_URI
public TachyonURI(String pathStr)
pathStr - path to construct the TachyonURI frompublic TachyonURI(String scheme, String authority, String path)
scheme - the scheme of the path. e.g. tachyon, hdfs, s3, file, null, etc.authority - the authority of the path. e.g. localhost:19998, 203.1.2.5:8080path - the path component of the URI. e.g. /abc/c.txt, /a b/c/c.txtpublic TachyonURI(TachyonURI parent, TachyonURI child)
parent - the parentchild - the childpublic int compareTo(TachyonURI other)
compareTo in interface Comparable<TachyonURI>public String getAuthority()
public int getDepth()
/ = 0 /a = 1 /a/b/c.txt = 3 /a/b/ = 3 a/b = 2 a\b = 2 tachyon://localhost:1998/ = 0 tachyon://localhost:1998/a = 1 tachyon://localhost:1998/a/b.txt = 2 C:\a = 1 C: = 0
public String getLeadingPath(int n)
/a/b/c, 0 = / /a/b/c, 1 = /a /a/b/c, 2 = /a/b /a/b/c, 3 = /a/b/c /a/b/c, 4 = null
n - identifies the number of path components to getpublic boolean containsWildcard()
boolean that indicates whether the TachyonURI contains wildcard(s)public String getHost()
public String getName()
public TachyonURI getParent()
public String getPath()
public int getPort()
public String getScheme()
public boolean hasAuthority()
public boolean hasScheme()
public boolean isAbsolute()
A TachyonURI is absolute if, and only if, it has a scheme component.
public boolean isPathAbsolute()
A path is absolute if, and only if, it starts with root.
public boolean isRoot()
A URI is root if its path equals to "/"
public TachyonURI join(String suffix)
suffix - the suffix to addpublic TachyonURI join(TachyonURI suffix)
suffix - the suffix to addCopyright © 2015. All Rights Reserved.