|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.caucho.vfs.Path | +--com.caucho.vfs.FilesystemPath
Abstract FilesystemPath, the parent of hierarchical Paths like FilePath or HttpPath.
Field Summary | |
protected com.caucho.vfs.BindPath |
bindRoot
|
protected java.lang.String |
pathname
|
protected FilesystemPath |
root
|
protected char |
separatorChar
|
protected java.lang.String |
userPath
|
Fields inherited from class com.caucho.vfs.Path |
L, schemeMap |
Constructor Summary | |
protected |
FilesystemPath(FilesystemPath root,
java.lang.String userPath,
java.lang.String pathname)
Create a new filesystemPath |
Method Summary | |
void |
bind(Path context)
Binds the context to the current path. |
Path |
copy()
|
Path |
createRoot(SchemeMap schemeMap)
Essentially chroot |
boolean |
equals(java.lang.Object b)
|
protected abstract Path |
fsWalk(java.lang.String userPath,
java.util.Map newAttributes,
java.lang.String newPath)
Lookup a path relative to the current filesystem's root. |
java.lang.String |
getFullPath()
For chrooted filesystems return the real system path. |
Path |
getParent()
Return the parent Path |
java.lang.String |
getPath()
Returns the path portion of the URL. |
java.lang.String |
getTail()
Returns the last segment of the path. |
java.lang.String |
getURL()
Returns the URL for this filesystem path. |
java.lang.String |
getUserPath()
Returns the last string used as a lookup, if available. |
int |
hashCode()
|
protected static void |
normalizePath(CharBuffer cb,
java.lang.String oldPath,
java.lang.String newPath,
int offset,
char separatorChar)
Normalizes a filesystemPath path. |
protected static java.lang.String |
normalizePath(java.lang.String oldPath,
java.lang.String newPath,
int offset,
char separatorChar)
wrapper for the real normalize path routine to use CharBuffer. |
protected Path |
schemeWalk(java.lang.String userPath,
java.util.Map attributes,
java.lang.String filePath,
int offset)
schemeWalk is called by Path for a scheme lookup like file:/tmp/foo |
void |
setUserPath(java.lang.String path)
Sets the user path. |
java.lang.String |
toString()
|
Methods inherited from class com.caucho.vfs.Path |
canRead, canWrite, createNewFile, createRoot, createTempFile, exists, getAttribute, getAttributeNames, getContentType, getHost, getLastModified, getLength, getNativePath, getObject, getPort, getQuery, getScheme, getValue, isDirectory, isFile, isObject, iterator, list, lookup, lookup, lookupNative, lookupNative, mkdir, mkdirs, openAppend, openAppendImpl, openRead, openReadImpl, openReadWrite, openReadWriteImpl, openWrite, openWriteImpl, remove, removeAttribute, renameTo, renameTo, scanScheme, setAttribute, setLastModified, setObject, setValue, unbind, writeToStream |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected FilesystemPath root
protected com.caucho.vfs.BindPath bindRoot
protected java.lang.String pathname
protected java.lang.String userPath
protected char separatorChar
Constructor Detail |
protected FilesystemPath(FilesystemPath root, java.lang.String userPath, java.lang.String pathname)
root
- Root of url spaceuserPath
- the user's pathpathname
- Canonical pathMethod Detail |
public Path getParent()
getParent
in class Path
protected Path schemeWalk(java.lang.String userPath, java.util.Map attributes, java.lang.String filePath, int offset)
schemeWalk
in class Path
userPath
- the user's lookup() pathattributes
- the user's attributesfilePath
- the actual lookup() pathoffset
- offset into filePathprotected abstract Path fsWalk(java.lang.String userPath, java.util.Map newAttributes, java.lang.String newPath)
userPath
- the exact string passed by the user's lookup()newAttributes
- the user's new attributesnewPath
- the normalized real pathprotected static java.lang.String normalizePath(java.lang.String oldPath, java.lang.String newPath, int offset, char separatorChar)
oldPath
- The parent Path's pathnewPath
- The user's new pathoffset
- Offset into the user pathprotected static void normalizePath(CharBuffer cb, java.lang.String oldPath, java.lang.String newPath, int offset, char separatorChar)
cb
- charBuffer holding the normalized resultoldPath
- the parent pathnewPath
- the relative pathoffset
- where in the child path to startpublic java.lang.String getURL()
getURL
in class Path
public java.lang.String getPath()
getPath
in class Path
public java.lang.String getUserPath()
Path
Path path = Pwd.lookup("/some/dir").lookup("../test.html");
System.out.println(path.getUserPath());
getUserPath
in class Path
public void setUserPath(java.lang.String path)
Path
setUserPath
in class Path
public java.lang.String getFullPath()
getFullPath
in class Path
public java.lang.String getTail()
Path
e.g. for http://www.caucho.com/products/index.html, getTail() returns 'index.html'
getTail
in class Path
public Path createRoot(SchemeMap schemeMap)
createRoot
in class Path
public void bind(Path context)
Path
bind
in class Path
public Path copy()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object b)
equals
in class Path
public java.lang.String toString()
toString
in class Path
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |