public class TachyonURI extends Object implements Comparable<TachyonURI>
Modifier and Type | Field and Description |
---|---|
static String |
CUR_DIR |
static String |
SEPARATOR |
Constructor and Description |
---|
TachyonURI(String pathStr)
Construct a path from a String.
|
TachyonURI(String scheme,
String authority,
String path)
Construct a Tachyon URI 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 |
equals(Object o) |
String |
getAuthority()
Gets the authority of this TachyonURI
|
int |
getDepth()
Return the number of elements of the path component of the TachyonURI.
|
String |
getHost()
Gets the host of this TachyonURI.
|
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 part component of this TachyonURI.
|
int |
getPort()
Gets the port of this TachyonURI.
|
String |
getScheme()
Get the scheme of the Tachyon URI.
|
boolean |
hasAuthority()
Tells if this TachyonURI has authority or not.
|
int |
hashCode() |
boolean |
hasScheme()
Tells if this TachyonURI has scheme or not.
|
boolean |
isAbsolute()
Tells whether or not this URI is absolute.
|
boolean |
isPathAbsolute()
Tells whether or not the path component of this TachyonURI is absolute.
|
TachyonURI |
join(String suffix)
Add a suffix to the end of the Tachyon URI.
|
TachyonURI |
join(TachyonURI suffix)
Add a suffix to the end of the Tachyon URI.
|
String |
toString()
Illegal characters unescaped in the string, for glob processing, etc.
|
public static final String SEPARATOR
public static final String CUR_DIR
public TachyonURI(String pathStr)
public 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 C:\a -> 1 C: -> 0 tachyon://localhost:1998/ -> 0 tachyon://localhost:1998/a -> 1 tachyon://localhost:1998/a/b.txt -> 2
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 URI 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 TachyonURI join(String suffix)
suffix
- the suffix to addpublic TachyonURI join(TachyonURI suffix)
TachyonURI
- the suffix to addCopyright © 2014. All rights reserved.