com.caucho.vfs
Class GooglePath

java.lang.Object
  extended by com.caucho.vfs.Path
      extended by com.caucho.vfs.FilesystemPath
          extended by com.caucho.vfs.GooglePath
All Implemented Interfaces:
java.lang.Comparable<Path>
Direct Known Subclasses:
GoogleBlobStorePath, GoogleStorePath

public abstract class GooglePath
extends FilesystemPath

FilePath implements the native filesystem.


Field Summary
protected  FileService _fileService
           
protected  GoogleInode _inode
           
protected  GoogleInodeService _inodeService
           
protected  GooglePath _parent
           
protected static java.lang.String QUERCUS_ROOT_PATH
           
 
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 GooglePath(FileService fileService, GoogleInodeService inodeService)
           
protected GooglePath(FilesystemPath root, java.lang.String userPath, java.lang.String path, FileService fileService, GoogleInodeService inodeService)
           
protected GooglePath(GooglePath path)
           
 
Method Summary
 boolean canRead()
          Tests if the file can be read.
 boolean canWrite()
          Tests if the file can be written.
 void clearStatusCache()
          Clears any status cache
 Path copy()
           
protected abstract  GooglePath createInstance(FilesystemPath root, java.lang.String userPath, java.lang.String path)
           
 boolean equals(java.lang.Object b)
           
 boolean exists()
          Tests if the file exists.
 Path fsWalk(java.lang.String userPath, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String path)
          Lookup the actual path relative to the filesystem root.
 java.lang.String getFullPath()
          For chrooted filesystems return the real system path.
 long getLastModified()
          Returns the last modified time of the file.
 long getLength()
          Returns the length of the file in bytes.
 int getMode()
          Returns equivalent of struct stat.st_mode if appropriate.
 GooglePath getParent()
          Return the parent Path
 java.lang.String getScheme()
          Returns the url scheme
 java.lang.String getURL()
          Returns the full url for the given path.
 int hashCode()
           
 void init()
          Call to initialize the root directory structure
 boolean isDirectory()
          Tests if the path refers to a directory.
 boolean isExecutable()
          Tests if the path is marked as executable
 boolean isFile()
          Tests if the path refers to a file.
protected  boolean isPathCacheable()
          Returns true if the path itself is cacheable
 java.lang.String[] list()
          Returns a list of files in the directory.
 boolean mkdir()
          Creates the directory named by this path.
 boolean mkdirs()
          Creates the directory named by this path and any parent directories.
 RandomAccessStream openFileRandomAccess()
          Opens a random-access stream.
 StreamImpl openReadImpl()
          Returns the stream implementation for a read stream.
 boolean remove()
          Removes the file or directory named by this path.
protected abstract  boolean removeImpl()
           
 boolean renameTo(Path path)
          Renames the file or directory to the name given by the path.
 void setLastModified(long time)
           
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.vfs.FilesystemPath
bind, createRoot, getPath, getRoot, getTail, getUserPath, init, normalizePath, normalizePath, schemeWalk, setUserPath
 
Methods inherited from class com.caucho.vfs.Path
cacheCopy, canExecute, changeGroup, changeGroup, changeOwner, changeOwner, chmod, compareTo, createDepend, createLink, createNewFile, createRoot, createTempFile, escapeURL, getAttribute, getAttributeNames, getBlockCount, getBlockSize, getCache, getCertificates, getContentType, getCrc64, getCreateTime, getDevice, getDeviceId, getDiskSpaceFree, getDiskSpaceTotal, getFileSeparatorChar, getGroup, getHost, getInode, getLastAccessTime, getLastStatusChangeTime, getNativePath, getNewlineString, getNumberOfLinks, getObject, getOwner, getPathSeparatorChar, getPort, getQuery, getRelativePath, getResources, getResources, getSchemeMap, getSeparatorChar, getUser, getUserDir, getValue, isBlockDevice, isCharacterDevice, isFIFO, isHardLink, isLink, isObject, isSocket, isSymbolicLink, isWindows, isWindowsInsecure, iterator, lookup, lookup, lookup, lookupChild, lookupImpl, lookupNative, lookupNative, lookupRelativeNativePath, openAppend, openAppendImpl, openMemoryMappedFile, openRandomAccess, openRead, openReadWrite, openReadWrite, openReadWrite, openReadWriteImpl, openWrite, openWriteImpl, putCache, readLink, realPath, removeAll, renameTo, scanScheme, sendfile, setDefaultSchemeMap, setExecutable, setObject, setTestWindows, setValue, truncate, truncate, unbind, unwrap, writeToStream, writeToStream
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERCUS_ROOT_PATH

protected static final java.lang.String QUERCUS_ROOT_PATH
See Also:
Constant Field Values

_fileService

protected FileService _fileService

_inodeService

protected GoogleInodeService _inodeService

_parent

protected GooglePath _parent

_inode

protected GoogleInode _inode
Constructor Detail

GooglePath

protected GooglePath(FilesystemPath root,
                     java.lang.String userPath,
                     java.lang.String path,
                     FileService fileService,
                     GoogleInodeService inodeService)
Parameters:
path - canonical path

GooglePath

protected GooglePath(FileService fileService,
                     GoogleInodeService inodeService)

GooglePath

protected GooglePath(GooglePath path)
Method Detail

init

public void init()
Call to initialize the root directory structure


getFullPath

public java.lang.String getFullPath()
Description copied from class: FilesystemPath
For chrooted filesystems return the real system path.

Overrides:
getFullPath in class FilesystemPath

fsWalk

public Path fsWalk(java.lang.String userPath,
                   java.util.Map<java.lang.String,java.lang.Object> attributes,
                   java.lang.String path)
Lookup the actual path relative to the filesystem root.

Specified by:
fsWalk in class FilesystemPath
Parameters:
userPath - the user's path to lookup()
attributes - the user's attributes to lookup()
path - the normalized path
Returns:
the selected path

createInstance

protected abstract GooglePath createInstance(FilesystemPath root,
                                             java.lang.String userPath,
                                             java.lang.String path)

getParent

public GooglePath getParent()
Description copied from class: FilesystemPath
Return the parent Path

Overrides:
getParent in class FilesystemPath

isPathCacheable

protected boolean isPathCacheable()
Returns true if the path itself is cacheable

Overrides:
isPathCacheable in class Path

getScheme

public java.lang.String getScheme()
Description copied from class: Path
Returns the url scheme

Specified by:
getScheme in class Path

getURL

public java.lang.String getURL()
Returns the full url for the given path.

Overrides:
getURL in class Path

exists

public boolean exists()
Description copied from class: Path
Tests if the file exists.

Overrides:
exists in class Path

getMode

public int getMode()
Description copied from class: Path
Returns equivalent of struct stat.st_mode if appropriate.

Overrides:
getMode in class Path

isExecutable

public boolean isExecutable()
Description copied from class: Path
Tests if the path is marked as executable

Overrides:
isExecutable in class Path

isDirectory

public boolean isDirectory()
Description copied from class: Path
Tests if the path refers to a directory.

Overrides:
isDirectory in class Path

isFile

public boolean isFile()
Description copied from class: Path
Tests if the path refers to a file.

Overrides:
isFile in class Path

getLength

public long getLength()
Description copied from class: Path
Returns the length of the file in bytes.

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

getLastModified

public long getLastModified()
Description copied from class: Path
Returns the last modified time of the file. According to the jdk, this may not correspond to the system time.

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

setLastModified

public void setLastModified(long time)
Overrides:
setLastModified in class Path

canRead

public boolean canRead()
Description copied from class: Path
Tests if the file can be read.

Overrides:
canRead in class Path

canWrite

public boolean canWrite()
Description copied from class: Path
Tests if the file can be written.

Overrides:
canWrite in class Path

list

public java.lang.String[] list()
                        throws java.io.IOException
Returns a list of files in the directory.

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

mkdir

public boolean mkdir()
              throws java.io.IOException
Description copied from class: Path
Creates the directory named by this path.

Overrides:
mkdir in class Path
Returns:
true if successful.
Throws:
java.io.IOException

mkdirs

public boolean mkdirs()
               throws java.io.IOException
Description copied from class: Path
Creates the directory named by this path and any parent directories.

Overrides:
mkdirs in class Path
Returns:
true if successful.
Throws:
java.io.IOException

remove

public boolean remove()
Description copied from class: Path
Removes the file or directory named by this path.

Overrides:
remove in class Path
Returns:
true if successful

removeImpl

protected abstract boolean removeImpl()

renameTo

public boolean renameTo(Path path)
                 throws java.io.IOException
Description copied from class: Path
Renames the file or directory to the name given by the path.

Overrides:
renameTo in class Path
Returns:
true if successful
Throws:
java.io.IOException

openReadImpl

public StreamImpl openReadImpl()
                        throws java.io.IOException
Returns the stream implementation for a read stream.

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

openFileRandomAccess

public RandomAccessStream openFileRandomAccess()
                                        throws java.io.IOException
Description copied from class: Path
Opens a random-access stream.

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

copy

public Path copy()
Overrides:
copy in class Path

clearStatusCache

public void clearStatusCache()
Description copied from class: Path
Clears any status cache

Overrides:
clearStatusCache in class Path

hashCode

public int hashCode()
Overrides:
hashCode in class FilesystemPath

equals

public boolean equals(java.lang.Object b)
Overrides:
equals in class FilesystemPath

toString

public java.lang.String toString()
Overrides:
toString in class Path