Package io.delta.kernel.internal.fs
Class Path
Object
io.delta.kernel.internal.fs.Path
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Comparable<Path>
Names a file or directory in a FileSystem. Path strings use slash as the directory separator.
Taken from https://github.com/apache/hadoop/blob/branch-3.3 .4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new Path based on the child path resolved against the parent path.Create a new Path based on the child path resolved against the parent path.Construct a path from a String.Create a new Path based on the child path resolved against the parent path.Create a new Path based on the child path resolved against the parent path.Construct a Path from components.Construct a path from a URI -
Method Summary
Modifier and TypeMethodDescriptionintbooleangetName()Returns the final component of this path.static StringReturns the parent of a path or null if at root.inthashCode()booleanReturns true if the path component (i.e.booleanisRoot()Returns true if and only if this path represents the root of a file system.booleanReturns true if the path component (i.e.toString()toUri()Convert this Path to a URI.voidValidate the contents of a deserialized Path, so as to defend against malicious object streams.
-
Field Details
-
SEPARATOR
The directory separator, a slash.- See Also:
-
SEPARATOR_CHAR
public static final char SEPARATOR_CHARThe directory separator, a slash, as a character.- See Also:
-
CUR_DIR
The current directory, ".".- See Also:
-
WINDOWS
public static final boolean WINDOWSWhether the current host is a Windows machine.
-
-
Constructor Details
-
Path
Create a new Path based on the child path resolved against the parent path.- Parameters:
parent- the parent pathchild- the child path
-
Path
Create a new Path based on the child path resolved against the parent path.- Parameters:
parent- the parent pathchild- the child path
-
Path
Create a new Path based on the child path resolved against the parent path.- Parameters:
parent- the parent pathchild- the child path
-
Path
Create a new Path based on the child path resolved against the parent path.- Parameters:
parent- the parent pathchild- the child path
-
Path
Construct a path from a String. Path strings are URIs, but with unescaped elements and some additional normalization.- Parameters:
pathString- the path string- Throws:
IllegalArgumentException
-
Path
Construct a path from a URI- Parameters:
aUri- the source URI
-
Path
Construct a Path from components.- Parameters:
scheme- the schemeauthority- the authoritypath- the path
-
-
Method Details
-
toUri
Convert this Path to a URI.- Returns:
- this Path as a URI
-
isUriPathAbsolute
public boolean isUriPathAbsolute()Returns true if the path component (i.e. directory) of this URI is absolute.- Returns:
- whether this URI's path is absolute
-
isAbsolute
public boolean isAbsolute()Returns true if the path component (i.e. directory) of this URI is absolute. This method is a wrapper forisUriPathAbsolute().- Returns:
- whether this URI's path is absolute
-
isRoot
public boolean isRoot()Returns true if and only if this path represents the root of a file system.- Returns:
- true if and only if this path represents the root of a file system
-
getName
Returns the final component of this path.- Returns:
- the final component of this path
-
getParent
Returns the parent of a path or null if at root.- Returns:
- the parent of a path or null if at root
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<Path>
-
validateObject
Validate the contents of a deserialized Path, so as to defend against malicious object streams.- Specified by:
validateObjectin interfaceObjectInputValidation- Throws:
InvalidObjectException- if there's no URI
-
getName
-