public class DavPath
extends java.lang.Object
You instantiate a new DavPath simply by saying
DavPath dp = new DavPath("/path/to/my/object");
If the path ends in a slash, it is understood to be a directory. If not, it represents a file.
Constructor and Description |
---|
DavPath(DavPath dp)
Creates a new DavPath from an old one.
|
DavPath(java.lang.String path)
Creates a new DavPath object.
|
Modifier and Type | Method and Description |
---|---|
void |
append(DavPath dp)
Adds another path to the end of this path.
|
void |
append(java.lang.String path)
Adds another path to the end of this path.
|
java.lang.String |
filePart()
Returns the file part of the DavPath.
|
java.lang.String |
get(int idx)
Returns the 'idx' component of the path, zero being the first component.
|
java.lang.String |
getName()
Returns the name of the last component of the DavPath.
|
java.lang.String |
getPath()
Returns the entire path as a String.
|
boolean |
isDirectory()
Returns true, if the path represents a directory.
|
boolean |
isRoot()
Returns true, if the path represents the top-level entity.
|
int |
length()
Exactly equivalent to size().
|
java.lang.String |
pathPart()
Returns the directory part of the DavPath.
|
int |
size()
Exactly equivalent to length().
|
DavPath |
subPath(int idx)
Returns a new DavPath object that is a sub-path of this path.
|
java.lang.String |
toString()
Returns a human-readable version of the path.
|
public DavPath(DavPath dp)
dp
- the dav pathpublic DavPath(java.lang.String path)
path
- public void append(DavPath dp)
dp
- the current dav pathpublic void append(java.lang.String path)
path
- the current dav pathpublic boolean isRoot()
public boolean isDirectory()
true
if the path is a directory; false
otherwisepublic java.lang.String pathPart()
public java.lang.String filePart()
public java.lang.String getName()
public java.lang.String getPath()
public DavPath subPath(int idx)
idx
- Start from this part.public java.lang.String get(int idx)
idx
- The component to return. Zero is the first element.public int size()
public int length()
public java.lang.String toString()
toString
in class java.lang.Object
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.