com.caucho.vfs
Class DatastorePath

java.lang.Object
  extended by com.caucho.vfs.Path
      extended by com.caucho.vfs.DatastorePath
All Implemented Interfaces:
java.lang.Comparable<Path>

public class DatastorePath
extends Path


Field Summary
protected  com.caucho.vfs.BindPath _bindRoot
           
protected  DatastorePath _root
           
static boolean IS_USE_HASHMAP
           
 
Fields inherited from class com.caucho.vfs.Path
_pathSeparatorChar, _schemeMap, _separatorChar, L
 
Constructor Summary
protected DatastorePath(DatastorePath root, java.lang.String pathname)
           
  DatastorePath(java.lang.String path)
           
 
Method Summary
static void dumpFiles()
           
 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)
           
 DatastoreFile getDatastoreFile()
           
 EntityManager getEntityManager()
           
static DatastoreFile getFile(java.lang.String name)
           
 java.lang.String getPath()
          Returns the path.
 java.lang.String getScheme()
          Returns the url scheme
protected static void normalizePath(CharBuffer cb, java.lang.String oldPath, java.lang.String newPath, int offset, char separatorChar)
           
protected static java.lang.String normalizePath(java.lang.String oldPath, java.lang.String newPath, int offset, char separatorChar)
           
 DatastoreRandomAccessStream openRandomAccess()
          Returns the stream implementation for a random-access stream.
 StreamImpl openReadImpl()
          Returns the stream implementation for a read stream.
 StreamImpl openWriteImpl()
           
 boolean remove()
          Removes the file or directory named by this path.
 Path schemeWalk(java.lang.String userPath, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String filePath, int offset)
          Lookup the path, handling windows weirdness
protected  Path schemeWalkImpl(java.lang.String userPath, java.util.Map<java.lang.String,java.lang.Object> attributes, java.lang.String filePath, int offset)
           
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.vfs.Path
bind, cacheCopy, canExecute, canRead, canWrite, changeGroup, changeGroup, changeOwner, changeOwner, chmod, clearStatusCache, compareTo, copy, createDepend, createLink, createNewFile, createRoot, createRoot, createTempFile, equals, escapeURL, getAttribute, getAttributeNames, getBlockCount, getBlockSize, getCache, getCertificates, getContentType, getCrc64, getCreateTime, getDevice, getDeviceId, getDiskSpaceFree, getDiskSpaceTotal, getFileSeparatorChar, getFullPath, getGroup, getHost, getInode, getLastAccessTime, getLastModified, getLastStatusChangeTime, getLength, getMode, getNativePath, getNewlineString, getNumberOfLinks, getObject, getOwner, getParent, getPathSeparatorChar, getPort, getQuery, getRelativePath, getResources, getResources, getSchemeMap, getSeparatorChar, getTail, getURL, getUser, getUserDir, getUserPath, getValue, hashCode, isBlockDevice, isCharacterDevice, isDirectory, isExecutable, isFIFO, isFile, isHardLink, isLink, isObject, isPathCacheable, isSocket, isSymbolicLink, isWindows, isWindowsInsecure, iterator, list, lookup, lookup, lookup, lookupImpl, lookupNative, lookupNative, lookupRelativeNativePath, mkdir, mkdirs, openAppend, openAppendImpl, openFileRandomAccess, openMemoryMappedFile, openRead, openReadWrite, openReadWrite, openReadWrite, openReadWriteImpl, openWrite, putCache, readLink, realPath, removeAll, renameTo, renameTo, scanScheme, setDefaultSchemeMap, setExecutable, setLastModified, setObject, setTestWindows, setUserPath, setValue, truncate, truncate, unbind, writeToStream, writeToStream
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IS_USE_HASHMAP

public static final boolean IS_USE_HASHMAP
See Also:
Constant Field Values

_root

protected DatastorePath _root

_bindRoot

protected com.caucho.vfs.BindPath _bindRoot
Constructor Detail

DatastorePath

public DatastorePath(java.lang.String path)

DatastorePath

protected DatastorePath(DatastorePath root,
                        java.lang.String pathname)
Method Detail

getEntityManager

public EntityManager getEntityManager()

getFile

public static DatastoreFile getFile(java.lang.String name)

dumpFiles

public static void dumpFiles()

getPath

public java.lang.String getPath()
Returns the path. e.g. for HTTP, returns the part after the host and port.

Specified by:
getPath in class Path

exists

public boolean exists()
Tests if the file exists.

Overrides:
exists in class Path

remove

public boolean remove()
               throws java.io.IOException
Removes the file or directory named by this path.

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

getScheme

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

Specified by:
getScheme in class Path

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

openWriteImpl

public StreamImpl openWriteImpl()
                         throws java.io.IOException
Overrides:
openWriteImpl in class Path
Throws:
java.io.IOException

openRandomAccess

public DatastoreRandomAccessStream openRandomAccess()
                                             throws java.io.IOException
Returns the stream implementation for a random-access stream.

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

getDatastoreFile

public DatastoreFile getDatastoreFile()

schemeWalk

public Path schemeWalk(java.lang.String userPath,
                       java.util.Map<java.lang.String,java.lang.Object> attributes,
                       java.lang.String filePath,
                       int offset)
Lookup the path, handling windows weirdness

Specified by:
schemeWalk in class Path
Parameters:
userPath - the user's lookup() path.
attributes - the attributes for the new path.
filePath - the lookup() path
offset - offset into newPath to start lookup.
Returns:
the found path

schemeWalkImpl

protected Path schemeWalkImpl(java.lang.String userPath,
                              java.util.Map<java.lang.String,java.lang.Object> attributes,
                              java.lang.String filePath,
                              int offset)

fsWalk

public Path fsWalk(java.lang.String userPath,
                   java.util.Map<java.lang.String,java.lang.Object> attributes,
                   java.lang.String path)

normalizePath

protected static java.lang.String normalizePath(java.lang.String oldPath,
                                                java.lang.String newPath,
                                                int offset,
                                                char separatorChar)

normalizePath

protected static void normalizePath(CharBuffer cb,
                                    java.lang.String oldPath,
                                    java.lang.String newPath,
                                    int offset,
                                    char separatorChar)

toString

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