|
|||||||||
| 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 |
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()
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. |
java.lang.String |
getTail()
Returns the last segment of the path. |
java.lang.String |
getURL()
Returns the full url for the given 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,
createTempFile,
exists,
getAttribute,
getAttributeNames,
getContentType,
getHost,
getLastModified,
getLength,
getNativePath,
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,
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 path| Method Detail |
public Path getParent()
protected Path schemeWalk(java.lang.String userPath,
java.util.Map attributes,
java.lang.String filePath,
int offset)
userPath - the user's lookup() pathattributes - the user's attributesfilePath - the actual lookup() pathoffset - offset into filePath
protected 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 path
protected 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 path
protected 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()
public java.lang.String getPath()
public java.lang.String getUserPath()
Path path = Pwd.lookup("/some/dir").lookup("../test.html");
System.out.println(path.getUserPath());
public void setUserPath(java.lang.String path)
public java.lang.String getFullPath()
public java.lang.String getTail()
e.g. for http://www.caucho.com/products/index.html, getTail() returns 'index.html'
public Path createRoot()
public void bind(Path context)
public Path copy()
public int hashCode()
public boolean equals(java.lang.Object b)
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||