com.nhncorp.neptune.fs
Class GPath

java.lang.Object
  extended by com.nhncorp.neptune.fs.GPath
All Implemented Interfaces:
java.lang.Comparable

public class GPath
extends java.lang.Object
implements java.lang.Comparable

파일 path에 대한 URI

Author:
nhn

Field Summary
static java.lang.String SEPARATOR
          The directory separator, a slash.
static char SEPARATOR_CHAR
           
 
Constructor Summary
GPath(GPath parent, GPath child)
          Resolve a child path against a parent path.
GPath(GPath parent, java.lang.String child)
          Resolve a child path against a parent path.
GPath(java.lang.String pathString)
          Construct a path from a String.
GPath(java.lang.String parent, GPath child)
          Resolve a child path against a parent path.
GPath(java.lang.String parent, java.lang.String child)
          Resolve a child path against a parent path.
GPath(java.lang.String scheme, java.lang.String authority, java.lang.String path)
          Construct a Path from components.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 int depth()
          Return the number of elements in this path.
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
          Returns the final component of this path.
 GPath getParent()
          Returns the parent of a path or null if at root.
 int hashCode()
           
 boolean isAbsolute()
          True if the directory of this path is absolute.
 GPath suffix(java.lang.String suffix)
          Adds a suffix to the final name in the path.
 java.lang.String toString()
           
 java.net.URI toUri()
          Convert this to a URI.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

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

See Also:
Constant Field Values

SEPARATOR_CHAR

public static final char SEPARATOR_CHAR
See Also:
Constant Field Values
Constructor Detail

GPath

public GPath(java.lang.String parent,
             java.lang.String child)
Resolve a child path against a parent path.


GPath

public GPath(GPath parent,
             java.lang.String child)
Resolve a child path against a parent path.


GPath

public GPath(java.lang.String parent,
             GPath child)
Resolve a child path against a parent path.


GPath

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


GPath

public GPath(java.lang.String pathString)
Construct a path from a String. Path strings are URIs, but with unescaped elements and some additional normalization.


GPath

public GPath(java.lang.String scheme,
             java.lang.String authority,
             java.lang.String path)
Construct a Path from components.

Method Detail

toUri

public java.net.URI toUri()
Convert this to a URI.


isAbsolute

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


getName

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


getParent

public GPath getParent()
Returns the parent of a path or null if at root.


suffix

public GPath suffix(java.lang.String suffix)
Adds a suffix to the final name in the path.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

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

depth

public int depth()
Return the number of elements in this path.