org.apache.hadoop.fs
Class Path

java.lang.Object
  extended by org.apache.hadoop.fs.Path
All Implemented Interfaces:
Comparable

public class Path
extends Object
implements Comparable

Names a file or directory in a FileSystem. Path strings use slash as the directory separator. A path string is absolute if it begins with a slash.


Field Summary
static String SEPARATOR
          The directory separator, a slash.
 
Constructor Summary
Path(Path parent, Path child)
          Resolve a child path against a parent path.
Path(Path parent, String child)
          Resolve a child path against a parent path.
Path(String pathString)
          Construct a path from a String.
Path(String parent, Path child)
          Resolve a child path against a parent path.
Path(String parent, String child)
          Resolve a child path against a parent path.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 String getName()
          Returns the final component of this path.
 Path getParent()
          Returns the parent of a path.
 int hashCode()
           
 boolean isAbsolute()
          True if this path is absolute.
 Path suffix(String suffix)
          Adds a suffix to a the final name in the path.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

public static final String SEPARATOR
The directory separator, a slash.

See Also:
Constant Field Values
Constructor Detail

Path

public Path(String parent,
            String child)
Resolve a child path against a parent path.


Path

public Path(Path parent,
            String child)
Resolve a child path against a parent path.


Path

public Path(String parent,
            Path child)
Resolve a child path against a parent path.


Path

public Path(Path parent,
            Path child)
Resolve a child path against a parent path.


Path

public Path(String pathString)
Construct a path from a String.

Method Detail

isAbsolute

public boolean isAbsolute()
True if this path is absolute.


getName

public String getName()
Returns the final component of this path.


getParent

public Path getParent()
Returns the parent of a path.


suffix

public Path suffix(String suffix)
Adds a suffix to a the final name in the path.


toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable


Copyright © 2006 The Apache Software Foundation