|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecyrd.jspwiki.dav.DavPath
public class DavPath
The DavPath represents an abstract path to any resource within the WebDav system. Since the file tree displayed by the DAV storage may be different from the actual representation, this component is needed.
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 Summary | |
---|---|
DavPath(DavPath dp)
Creates a new DavPath from an old one. |
|
DavPath(String path)
Creates a new DavPath object. |
Method Summary | |
---|---|
void |
append(DavPath dp)
Adds another path to the end of this path. |
void |
append(String path)
Adds another path to the end of this path. |
String |
filePart()
Returns the file part of the DavPath. |
String |
get(int idx)
Returns the 'idx' component of the path, zero being the first component. |
String |
getName()
Returns the name of the last component of the DavPath. |
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(). |
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. |
String |
toString()
Returns a human-readable version of the path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DavPath(DavPath dp)
dp
- the dav pathpublic DavPath(String path)
path
- Method Detail |
---|
public void append(DavPath dp)
dp
- the current dav pathpublic void append(String path)
path
- the current dav pathpublic boolean isRoot()
public boolean isDirectory()
true
if the path is a directory; false
otherwisepublic String pathPart()
public String filePart()
public String getName()
public String getPath()
public DavPath subPath(int idx)
idx
- Start from this part.
public String get(int idx)
idx
- The component to return. Zero is the first element.
public int size()
public int length()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |