Package io.milton.common
Class Path
- java.lang.Object
-
- io.milton.common.Path
-
- All Implemented Interfaces:
Serializable
public class Path extends Object implements Serializable
Immutable- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPath.LengthComparator
-
Field Summary
Fields Modifier and Type Field Description static Path.LengthComparatorLENGTH_COMPARATORstatic Pathroot
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Pathadd(Path p)Add the path components of the given path to this one.Pathchild(String name)booleanequals(Object obj)List<String>getAfterFirst()StringgetFirst()intgetLength()StringgetName()PathgetParent()String[]getParts()PathgetStripFirst()inthashCode()booleanisRelative()booleanisRoot()static Pathpath(Path parent, String path)static Pathpath(String path)static Pathroot()StringtoPath()StringtoString()StringtoString(String delimiter)
-
-
-
Field Detail
-
root
public static final Path root
-
LENGTH_COMPARATOR
public static final Path.LengthComparator LENGTH_COMPARATOR
-
-
Method Detail
-
getLength
public int getLength()
-
getParts
public String[] getParts()
-
getFirst
public String getFirst()
- Returns:
- - the first part of the path. ie a/b/c returns a
-
getStripFirst
public Path getStripFirst()
-
getName
public String getName()
-
getParent
public Path getParent()
-
isRoot
public boolean isRoot()
-
toPath
public String toPath()
-
root
public static Path root()
-
isRelative
public boolean isRelative()
-
-