Package com.wavemaker.commons.io
Class ResourcePath
- java.lang.Object
-
- com.wavemaker.commons.io.ResourcePath
-
- All Implemented Interfaces:
java.io.Serializable
public final class ResourcePath extends java.lang.Object implements java.io.SerializableA file or folder path.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourcePath()Create a new root path instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourcePathappend(ResourcePath path)Append the given path to this pathbooleanequals(java.lang.Object obj)ResourcePathget(java.lang.String path)Get a new path relative to this one.java.lang.StringgetName()Returns the name of the path element.ResourcePathgetParent()Returns the parent of the path or null if this is a root path.inthashCode()booleanisRootPath()Returns true if this path is a root path.java.lang.StringtoString()Returns the full path value.java.lang.StringtoStringRelativeTo(ResourcePath source)java.lang.StringtoStringRelativeTo(java.lang.String source)
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the path element.- Returns:
- the name
-
toString
public java.lang.String toString()
Returns the full path value.- Overrides:
toStringin classjava.lang.Object- Returns:
- the path value
-
toStringRelativeTo
public java.lang.String toStringRelativeTo(java.lang.String source)
-
toStringRelativeTo
public java.lang.String toStringRelativeTo(ResourcePath source)
-
get
public ResourcePath get(java.lang.String path)
Get a new path relative to this one.- Parameters:
path- the path to obtain.- Returns:
- a new path
-
getParent
public ResourcePath getParent()
Returns the parent of the path or null if this is a root path.- Returns:
- the parent or null
-
isRootPath
public boolean isRootPath()
Returns true if this path is a root path.- Returns:
- if this is a root path
-
append
public ResourcePath append(ResourcePath path)
Append the given path to this path- Parameters:
path- the path to append- Returns:
- a new path
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-