java.lang.Comparable<PathData>@Private @Unstable public class PathData extends java.lang.Object implements java.lang.Comparable<PathData>
| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
PathData.FileTypeRequirement |
|
protected static class |
PathData.PathType |
| Modifier and Type | Field | Description |
|---|---|---|
boolean |
exists |
|
FileSystem |
fs |
|
Path |
path |
|
FileStatus |
stat |
|
protected java.net.URI |
uri |
| Constructor | Description |
|---|---|
PathData(java.lang.String pathString,
Configuration conf) |
Creates an object to wrap the given parameters as fields.
|
PathData(java.net.URI localPath,
Configuration conf) |
Creates an object to wrap the given parameters as fields.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
compareTo(PathData o) |
|
boolean |
equals(java.lang.Object o) |
|
static PathData[] |
expandAsGlob(java.lang.String pattern,
Configuration conf) |
Expand the given path as a glob pattern.
|
PathData[] |
getDirectoryContents() |
Returns a list of PathData objects of the items contained in the given
directory.
|
RemoteIterator<PathData> |
getDirectoryContentsIterator() |
Returns a RemoteIterator for PathData objects of the items contained in the
given directory.
|
PathData |
getPathDataForChild(PathData child) |
Creates a new object for a child entry in this directory
|
int |
hashCode() |
|
protected FSDataInputStream |
openFile(java.lang.String policy) |
Open a file.
|
protected FSDataInputStream |
openForSequentialIO() |
Open a file for sequential IO.
|
boolean |
parentExists() |
Test if the parent directory exists
|
FileStatus |
refreshStatus() |
Updates the paths's file status
|
boolean |
representsDirectory() |
Check if the path represents a directory as determined by the basename
being "." or "..", or the path ending with a directory separator
|
PathData |
suffix(java.lang.String extension) |
Returns a new PathData with the given extension.
|
java.io.File |
toFile() |
Get the path to a local file
|
java.lang.String |
toString() |
Returns the printable version of the path that is either the path
as given on the commandline, or the full path
|
protected final java.net.URI uri
public final FileSystem fs
public final Path path
public FileStatus stat
public boolean exists
public PathData(java.lang.String pathString,
Configuration conf)
throws java.io.IOException
pathString - a string for a pathconf - the configuration filejava.io.IOException - if anything goes wrong...public PathData(java.net.URI localPath,
Configuration conf)
throws java.io.IOException
localPath - a local URIconf - the configuration filejava.io.IOException - if anything goes wrong...public FileStatus refreshStatus() throws java.io.IOException
java.io.IOException - if anything goes wrong...public PathData suffix(java.lang.String extension) throws java.io.IOException
extension - for the suffixjava.io.IOException - shouldn't happenpublic boolean parentExists()
throws java.io.IOException
java.io.IOException - upon unexpected errorpublic boolean representsDirectory()
public PathData[] getDirectoryContents() throws java.io.IOException
java.io.IOException - if anything else goes wrong...public RemoteIterator<PathData> getDirectoryContentsIterator() throws java.io.IOException
java.io.IOException - if anything else goes wrong...public PathData getPathDataForChild(PathData child) throws java.io.IOException
child - the basename will be appended to this object's pathjava.io.IOException - if this object does not exist or is not a directorypublic static PathData[] expandAsGlob(java.lang.String pattern, Configuration conf) throws java.io.IOException
pattern - the pattern to expand as a globconf - the hadoop configurationPathData objects. if the pattern is not a glob,
and does not exist, the list will contain a single PathData with a null
statjava.io.IOException - anything else goes wrong...public java.lang.String toString()
toString in class java.lang.Objectpublic java.io.File toFile()
java.lang.IllegalArgumentException - if this.fs is not the LocalFileSystempublic int compareTo(PathData o)
compareTo in interface java.lang.Comparable<PathData>public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectprotected FSDataInputStream openForSequentialIO() throws java.io.IOException
This uses FileSystem.openFile() to request sequential IO; the file status is also passed in. Filesystems may use to optimize their IO.
java.io.IOException - failureprotected FSDataInputStream openFile(java.lang.String policy) throws java.io.IOException
policy - fadvise policy.java.io.IOException - failureCopyright © 2008–2025 Apache Software Foundation. All rights reserved.