public class ResourcePath extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
_name |
protected ResourcePath |
_parent |
static String |
WINDOWS_NETWORK_ROOT |
Modifier | Constructor and Description |
---|---|
protected |
ResourcePath(ResourcePath parent,
String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Two ResourcePath objects are considered to be equal if they represent the same leaf path and if their parents
are equal.
|
String |
getFileSystemPathString()
Returns the path string for this path using the default file system separator,
as defined by the File.separator property.
|
String |
getName()
Returns the leaf name of this resource path.
|
ResourcePath |
getParent()
Returns the parent of this resource path.
|
String |
getPathString()
Returns the path string for this path using the / path separator.
|
String |
getPathString(String separator)
Returns the path string for this path using the specified path separator.
|
int |
hashCode() |
boolean |
isChild(ResourcePath path) |
boolean |
isDescendant(ResourcePath path) |
ResourcePath |
join(String otherPath)
Takes the specified path fragment and joins it with this ResourcePath to create a new ResourcePath.
|
static ResourcePath |
parse(String pathString) |
String |
relativePath(ResourcePath other) |
String |
relativePath(ResourcePath other,
String separator) |
public static final String WINDOWS_NETWORK_ROOT
protected final ResourcePath _parent
protected final String _name
protected ResourcePath(ResourcePath parent, String name)
public static ResourcePath parse(String pathString)
public String getName()
This method will never return a null value.
public ResourcePath getParent()
public String getPathString()
getPathString(String)
public String getFileSystemPathString()
getPathString(String)
public String getPathString(String separator)
separator
- the separator to use when constructing the pathpublic ResourcePath join(String otherPath)
otherPath
- the path to join with this onepublic boolean equals(Object obj)
public boolean isChild(ResourcePath path)
public boolean isDescendant(ResourcePath path)
public String relativePath(ResourcePath other)
public String relativePath(ResourcePath other, String separator)
Copyright © 2024. All rights reserved.