public abstract class FilesystemPath extends Path
Path.FileChannelFactory
Modifier and Type | Field and Description |
---|---|
protected com.caucho.vfs.BindPath |
_bindRoot |
protected java.lang.String |
_pathname |
protected FilesystemPath |
_root |
protected java.lang.String |
_userPath |
_pathSeparatorChar, _schemeMap, _separatorChar, L
Modifier | Constructor and Description |
---|---|
protected |
FilesystemPath(FilesystemPath root,
java.lang.String userPath,
java.lang.String pathname)
Create a new filesystemPath
|
Modifier and Type | Method and Description |
---|---|
void |
bind(Path context)
Binds the context to the current path.
|
Path |
createRoot(SchemeMap schemeMap)
Essentially chroot
|
boolean |
equals(java.lang.Object b) |
abstract Path |
fsWalk(java.lang.String userPath,
java.util.Map<java.lang.String,java.lang.Object> 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.
|
FilesystemPath |
getRoot()
Returns the root.
|
java.lang.String |
getTail()
Returns the last segment of the path.
|
java.lang.String |
getUserPath()
Return's the application's name for the path, e.g.
|
int |
hashCode() |
protected void |
init(FilesystemPath root,
java.lang.String userPath,
java.lang.String pathname) |
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.
|
Path |
schemeWalk(java.lang.String userPath,
java.util.Map<java.lang.String,java.lang.Object> 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.
|
cacheCopy, canExecute, canRead, canWrite, changeGroup, changeGroup, changeOwner, changeOwner, chmod, clearStatusCache, compareTo, copy, createDepend, createLink, createNewFile, createRoot, createTempFile, escapeURL, exists, fileChannelFactory, getAttribute, getAttributeNames, getBlockCount, getBlockSize, getCache, getCertificates, getContentType, getCrc64, getCreateTime, getDevice, getDeviceId, getDiskSpaceFree, getDiskSpaceTotal, getFileSeparatorChar, getGroup, getHost, getInode, getLastAccessTime, getLastModified, getLastStatusChangeTime, getLength, getMode, getNativePath, getNewlineString, getNumberOfLinks, getObject, getOwner, getPathSeparatorChar, getPort, getQuery, getRelativePath, getResources, getResources, getScheme, getSchemeMap, getSeparatorChar, getURL, getUser, getUserDir, getValue, isBlockDevice, isCharacterDevice, isDirectory, isExecutable, isFIFO, isFile, isHardLink, isLink, isObject, isPathCacheable, isSocket, isSymbolicLink, isWindows, isWindowsInsecure, iterator, list, lookup, lookup, lookup, lookupChild, lookupImpl, lookupNative, lookupNative, lookupRelativeNativePath, mkdir, mkdirs, openAppend, openAppendImpl, openFileRandomAccess, openMemoryMappedFile, openRandomAccess, openRead, openReadImpl, openReadWrite, openReadWrite, openReadWrite, openReadWriteImpl, openWrite, openWriteImpl, putCache, readLink, realPath, remove, removeAll, renameTo, renameTo, scanScheme, sendfile, setDefaultSchemeMap, setExecutable, setLastModified, setObject, setTestWindows, setValue, toString, truncate, truncate, unbind, unwrap, writeToStream, writeToStream
protected FilesystemPath _root
protected com.caucho.vfs.BindPath _bindRoot
protected java.lang.String _pathname
protected java.lang.String _userPath
protected FilesystemPath(FilesystemPath root, java.lang.String userPath, java.lang.String pathname)
root
- Root of url spaceuserPath
- the user's pathpathname
- Canonical pathprotected void init(FilesystemPath root, java.lang.String userPath, java.lang.String pathname)
public Path schemeWalk(java.lang.String userPath, java.util.Map<java.lang.String,java.lang.Object> 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 filePathpublic abstract Path fsWalk(java.lang.String userPath, java.util.Map<java.lang.String,java.lang.Object> 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 FilesystemPath getRoot()
public java.lang.String getPath()
public java.lang.String 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'
public Path createRoot(SchemeMap schemeMap)
createRoot
in class Path
public void bind(Path context)
Path