org.crsh.vfs
Class Path
java.lang.Object
org.crsh.vfs.Path
- All Implemented Interfaces:
- Iterable<String>
- Direct Known Subclasses:
- Path.Absolute, Path.Relative
-
public abstract class Path
- extends Object
-
- implements Iterable<String>
-
Constructor Summary |
private |
Path(boolean dir, String[] names)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
EMPTY_STRING
private static final String[] EMPTY_STRING
-
.
ROOT
public static final Path.Absolute ROOT
-
.
EMPTY
public static final Path.Relative EMPTY
-
.
dir
protected final boolean dir
-
.
names
protected final String[] names
-
.
value
private String value
-
.
Path
private Path(boolean dir,
String[] names)
path
private static String[] path(File file,
int size)
-
-
get
public static Path get(File file)
-
-
get
public static Path get(String s)
-
-
parseNames
private static String[] parseNames(String s,
int prev,
int end,
int count)
-
-
iterator
public Iterator<String> iterator()
-
- Specified by:
iterator
in interface Iterable<String>
-
append
public Path append(String name,
boolean dir)
-
-
create
protected abstract Path create(boolean dir,
String[] names)
-
-
isAbsolute
public abstract boolean isAbsolute()
-
-
absolute
public abstract Path.Absolute absolute()
-
-
getSize
public int getSize()
-
-
isDir
public boolean isDir()
-
-
getName
public String getName()
-
-
nameAt
public String nameAt(int index)
throws IndexOutOfBoundsException
-
-
- Throws:
IndexOutOfBoundsException
isChildOf
public boolean isChildOf(Path parent)
-
-
equals
public boolean equals(Object o)
-
- Overrides:
equals
in class Object
-
hashCode
public int hashCode()
-
- Overrides:
hashCode
in class Object
-
getValue
public String getValue()
-
Returns the canonical path value.
-
-
- Returns:
- the value
toString
public String toString()
-
- Overrides:
toString
in class Object
-
Copyright © 2015 eXo Platform SAS. All Rights Reserved.