- java.lang.Object
-
- com.pervasive.datarush.hadoop.io.HadoopFilePath
-
- All Implemented Interfaces:
Path
,Serializable
public class HadoopFilePath extends Object implements Path
Implementation of a path for the Hadoop Distributed File System (HDFS).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HadoopFilePath(String path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HadoopFilePath
cast(Path p)
boolean
equals(Object o)
HadoopFileSystemProvider
getFileSystemProvider()
Gets the file system provider for this path.String
getName()
Gets the last element of the path.Path
getParent()
Gets the path referring to the location containing the path.String
getPath()
Get the HDFS specific path object for this path.int
hashCode()
boolean
isAbsolute()
Indicates whether the path is absolute or relative.Path
resolve(String other)
Adds additional elements to the path.Path
toAbsolutePath()
Converts a relative path into an absolute path.File
toFile()
Gets the local file corresponding to the path.String
toString()
Gets the string representation of the path.String
toURL()
Returns the URL string corresponding to this path.
-
-
-
Constructor Detail
-
HadoopFilePath
public HadoopFilePath(String path)
-
-
Method Detail
-
cast
public static HadoopFilePath cast(Path p)
-
getFileSystemProvider
public HadoopFileSystemProvider getFileSystemProvider()
Description copied from interface:Path
Gets the file system provider for this path.- Specified by:
getFileSystemProvider
in interfacePath
- Returns:
- the file system provider associated with the path
-
isAbsolute
public boolean isAbsolute()
Description copied from interface:Path
Indicates whether the path is absolute or relative. That is, does the path start from the root of the associated file system.For most file systems, all paths are absolute.
- Specified by:
isAbsolute
in interfacePath
- Returns:
true
if the path starts from the file system root,false
otherwise.
-
toAbsolutePath
public Path toAbsolutePath()
Description copied from interface:Path
Converts a relative path into an absolute path.- Specified by:
toAbsolutePath
in interfacePath
- Returns:
- the absolute path pointing to the same location. If the path is already absolute, it is returned.
-
getParent
public Path getParent()
Description copied from interface:Path
Gets the path referring to the location containing the path.
-
getName
public String getName()
Description copied from interface:Path
Gets the last element of the path.
-
resolve
public Path resolve(String other)
Description copied from interface:Path
Adds additional elements to the path. The provided string is interpreted as a relative path starting from the path's location.
-
toFile
public File toFile()
Description copied from interface:Path
Gets the local file corresponding to the path. This only makes sense when the path refers to the local file system. For other paths, it always returnsnull
.
-
toString
public String toString()
Description copied from interface:Path
Gets the string representation of the path. It must be true thatPaths.asPath(path.toString())
refers to the same location aspath
. However, it may not the case thatpathString.equals(Paths.asPath(pathString).toString())
.
-
toURL
public String toURL()
Description copied from interface:Path
Returns the URL string corresponding to this path.
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
getPath
public String getPath()
Get the HDFS specific path object for this path.- Returns:
- HDFS path
-
-