com.caucho.vfs.remote
Class RemotePath

java.lang.Object
  extended by com.caucho.vfs.Path
      extended by com.caucho.vfs.FilesystemPath
          extended by com.caucho.vfs.remote.RemotePath
All Implemented Interfaces:
java.lang.Comparable<Path>
Direct Known Subclasses:
RemotePathRoot

public class RemotePath
extends FilesystemPath

Remote filesystem


Field Summary
 
Fields inherited from class com.caucho.vfs.FilesystemPath
_bindRoot, _pathname, _root, _userPath
 
Fields inherited from class com.caucho.vfs.Path
_pathSeparatorChar, _schemeMap, _separatorChar, L
 
Constructor Summary
protected RemotePath(RemotePathRoot root, java.lang.String userPath, java.lang.String pathname)
          Create a new RemoteFilesystem
  RemotePath(java.lang.String url, Path dbDirectory, java.lang.String tableName)
          Create the root new RemoteFilesystem
 
Method Summary
 boolean canRead()
          Returns true if the file is readable.
 boolean canWrite()
          Returns true if the file is writable
protected  Path copy()
           
 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.
 long getCrc64()
          Returns the digest
 long getLastModified()
          Returns the last modified time
 long getLength()
          Returns the length.
 java.lang.String getScheme()
          Returns the scheme.
 boolean isDirectory()
          Returns true for directory
 boolean isFile()
          Returns true for regular files
 java.lang.String[] list()
          Lists the directory contents
 StreamImpl openReadImpl()
          Opens a read stream.
 
Methods inherited from class com.caucho.vfs.FilesystemPath
bind, createRoot, equals, getFullPath, getParent, getPath, getRoot, getTail, getUserPath, hashCode, normalizePath, normalizePath, schemeWalk, setUserPath
 
Methods inherited from class com.caucho.vfs.Path
cacheCopy, canExecute, changeGroup, changeGroup, changeOwner, changeOwner, chmod, clearStatusCache, compareTo, createDepend, createLink, createNewFile, createRoot, createTempFile, escapeURL, exists, getAttribute, getAttributeNames, getBlockCount, getBlockSize, getCache, getCertificates, getContentType, getCreateTime, getDevice, getDeviceId, getDiskSpaceFree, getDiskSpaceTotal, getFileSeparatorChar, getGroup, getHost, getInode, getLastAccessTime, getLastStatusChangeTime, getMode, getNativePath, getNewlineString, getNumberOfLinks, getObject, getOwner, getPathSeparatorChar, getPort, getQuery, getRelativePath, getResources, getResources, getSchemeMap, getSeparatorChar, getURL, getUser, getUserDir, getValue, isBlockDevice, isCharacterDevice, isExecutable, isFIFO, isHardLink, isLink, isObject, isPathCacheable, isSocket, isSymbolicLink, isWindows, isWindowsInsecure, iterator, lookup, lookup, lookup, lookupImpl, lookupNative, lookupNative, lookupRelativeNativePath, mkdir, mkdirs, openAppend, openAppendImpl, openFileRandomAccess, openMemoryMappedFile, openRandomAccess, openRead, openReadWrite, openReadWrite, openReadWrite, openReadWriteImpl, openWrite, openWriteImpl, putCache, readLink, realPath, remove, removeAll, renameTo, renameTo, scanScheme, setDefaultSchemeMap, setExecutable, setLastModified, setObject, setTestWindows, setValue, toString, truncate, truncate, unbind, writeToStream, writeToStream
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemotePath

public RemotePath(java.lang.String url,
                  Path dbDirectory,
                  java.lang.String tableName)
           throws java.lang.Exception
Create the root new RemoteFilesystem

Parameters:
url - the remote url
Throws:
java.lang.Exception

RemotePath

protected RemotePath(RemotePathRoot root,
                     java.lang.String userPath,
                     java.lang.String pathname)
Create a new RemoteFilesystem

Parameters:
root - Root of url space
userPath - the user's path
pathname - Canonical path
Method Detail

fsWalk

public 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. Filesystems will specialize fsWalk.

Specified by:
fsWalk in class FilesystemPath
Parameters:
userPath - the exact string passed by the user's lookup()
newAttributes - the user's new attributes
newPath - the normalized real path
Returns:
the matching path

getScheme

public java.lang.String getScheme()
Returns the scheme.

Specified by:
getScheme in class Path

getLength

public long getLength()
Returns the length.

Overrides:
getLength in class Path
Returns:
0 for non-files

getLastModified

public long getLastModified()
Returns the last modified time

Overrides:
getLastModified in class Path
Returns:
0 for non-files.

getCrc64

public long getCrc64()
Returns the digest

Overrides:
getCrc64 in class Path

isFile

public boolean isFile()
Returns true for regular files

Overrides:
isFile in class Path

isDirectory

public boolean isDirectory()
Returns true for directory

Overrides:
isDirectory in class Path

canRead

public boolean canRead()
Returns true if the file is readable.

Overrides:
canRead in class Path

canWrite

public boolean canWrite()
Returns true if the file is writable

Overrides:
canWrite in class Path

list

public java.lang.String[] list()
                        throws java.io.IOException
Lists the directory contents

Overrides:
list in class Path
Returns:
The contents of this directory or null if the path does not refer to a directory.
Throws:
java.io.IOException

openReadImpl

public StreamImpl openReadImpl()
                        throws java.io.IOException
Opens a read stream.

Overrides:
openReadImpl in class Path
Throws:
java.io.IOException

copy

protected Path copy()
Overrides:
copy in class Path