public class Path
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CUR_DIR
The current directory
|
static java.lang.String |
SEPARATOR
The directory seperator, a slash
|
static char |
SEPARATOR_CHAR
The directory separator, a slash as char
|
Constructor and Description |
---|
Path()
Empty constructor
|
Path(Path parent,
Path child) |
Path(Path parent,
java.lang.String child)
Resolve a child path against a parent path.
|
Path(java.lang.String pathString)
Create path from given path String
|
Path(java.lang.String parent,
Path child)
constructor
|
Path(java.lang.String parent,
java.lang.String child)
create Path with parent and child
|
Path(java.lang.String scheme,
java.lang.String authority,
java.lang.String path) |
Path(java.net.URI uri)
Create Path with given URI
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Returns the final component of this path, i.e., everything that follows the last separator.
|
Path |
getParent() |
java.lang.String |
getPath()
get full path.
|
boolean |
isAbsolute()
Checks if the directory of this path is absolute.
|
boolean |
isNullOrEmpty()
Check if the path is null or empty
|
Path |
makeQualified(FileSystem fs)
Returns a qualified path object.
|
java.lang.String |
toString() |
java.net.URI |
toUri()
Converts the path object to a
URI . |
public static final java.lang.String SEPARATOR
public static final char SEPARATOR_CHAR
public static final java.lang.String CUR_DIR
public Path()
public Path(java.net.URI uri)
public Path(java.lang.String parent, java.lang.String child)
public Path(java.lang.String parent, Path child)
public Path(java.lang.String scheme, java.lang.String authority, java.lang.String path)
public Path(Path parent, java.lang.String child)
parent
- the parent pathchild
- the child pathpublic Path(java.lang.String pathString)
public java.net.URI toUri()
URI
.URI
object converted from the path objectpublic java.lang.String getPath()
public Path getParent()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getName()
public Path makeQualified(FileSystem fs)
fs
- the FileSystem that should be used to obtain the current working directorypublic boolean isAbsolute()
true
if the directory of this path is absolute,
false
otherwisepublic boolean isNullOrEmpty()