Package org.qdl_lang.vfs
Class AbstractVFSFileProvider
- java.lang.Object
- 
- org.qdl_lang.vfs.AbstractVFSFileProvider
 
- 
- All Implemented Interfaces:
- Serializable,- VFSFileProvider
 - Direct Known Subclasses:
- VFSMemoryFileProvider,- VFSMySQLProvider,- VFSPassThruFileProvider,- VFSZipFileProvider
 
 public abstract class AbstractVFSFileProvider extends Object implements VFSFileProvider Created by Jeff Gaynor 
 on 2/28/20 at 5:07 PM- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description AbstractVFSFileProvider(String scheme, String mountPoint, boolean canRead, boolean canWrite)Constructor without a current directoryAbstractVFSFileProvider(String scheme, String mountPoint, String currentDir, boolean canRead, boolean canWrite)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRead()booleancanWrite()protected voidcheckPath(String path)booleancheckScheme(String name)Checks if the name has the scheme for this provider.booleancontains(String path)Contains is a type of read.voiddelete(String path)A delete is a type of write.String[]dir(String path)booleaneasSupported()If this store supports extended attributes.VFSEntryget(String path, int type)Get the named item.StringgetCurrentDir()edu.uiuc.ncsa.security.core.configuration.XPropertiesgetFileInfo(String path)StringgetMountPoint()This is the mount point for the virtual file system.protected StringgetRealPath(String path)Resolves this against any current directory and returns the unqualified *relative* path against the store's root path.StringgetScheme()The scheme that uniquely identifies this providerStringgetStoreRoot()The root fo this store.static booleanisAbsolute(String path)Returns if this path is absolute, i.e.protected booleanisChildOf(String[] top, String target, boolean isRoot)Use this for stores that keep everything in a flat list (like a database table or hash map of file paths.) You useVFSPaths.toPathComponents(String)on the argument to thedir(String)command and specify if it is the root node (since figuring that out is store dependent).booleanisDirectory(String path)booleanisScript(String name)Checks if the FQ name can be resolved to a script by this provider.longlength(String path)booleanmkdir(String path)Make a set of directories.voidput(String newPath, VFSEntry entry)Add the using the path.voidput(VFSEntry entry)Put this in the store at its current pathvoidrm(String path)Remove a file from the store.booleanrmdir(String path)This will remove a directory.voidsetCurrentDir(String path)voidsetMountPoint(String mountPoint)The mount point does both start and end with the path separator since we always need it.voidsetRead(boolean newValue)voidsetScheme(String scheme)The scheme is does not end with the scheme delimiter and should be normalized here.voidsetWrite(boolean newValue)protected StringunqualifyPath(String x)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.qdl_lang.vfs.VFSFileProvidergetType
 
- 
 
- 
- 
- 
Method Detail- 
getMountPointpublic String getMountPoint() Description copied from interface:VFSFileProviderThis is the mount point for the virtual file system.- Specified by:
- getMountPointin interface- VFSFileProvider
- Returns:
 
 - 
setSchemepublic void setScheme(String scheme) Description copied from interface:VFSFileProviderThe scheme is does not end with the scheme delimiter and should be normalized here.- Specified by:
- setSchemein interface- VFSFileProvider
 
 - 
setMountPointpublic void setMountPoint(String mountPoint) Description copied from interface:VFSFileProviderThe mount point does both start and end with the path separator since we always need it. The mount point should be normalized in the setter.- Specified by:
- setMountPointin interface- VFSFileProvider
 
 - 
getSchemepublic String getScheme() Description copied from interface:VFSFileProviderThe scheme that uniquely identifies this provider- Specified by:
- getSchemein interface- VFSFileProvider
- Returns:
 
 - 
checkSchemepublic boolean checkScheme(String name) Description copied from interface:VFSFileProviderChecks if the name has the scheme for this provider.- Specified by:
- checkSchemein interface- VFSFileProvider
- Returns:
 
 - 
canReadpublic boolean canRead() - Specified by:
- canReadin interface- VFSFileProvider
 
 - 
canWritepublic boolean canWrite() - Specified by:
- canWritein interface- VFSFileProvider
 
 - 
setReadpublic void setRead(boolean newValue) - Specified by:
- setReadin interface- VFSFileProvider
 
 - 
setWritepublic void setWrite(boolean newValue) - Specified by:
- setWritein interface- VFSFileProvider
 
 - 
getFileInfopublic edu.uiuc.ncsa.security.core.configuration.XProperties getFileInfo(String path) throws Throwable - Specified by:
- getFileInfoin interface- VFSFileProvider
- Throws:
- Throwable
 
 - 
getCurrentDirpublic String getCurrentDir() - Specified by:
- getCurrentDirin interface- VFSFileProvider
 
 - 
setCurrentDirpublic void setCurrentDir(String path) - Specified by:
- setCurrentDirin interface- VFSFileProvider
 
 - 
checkPathprotected void checkPath(String path) 
 - 
isScriptpublic boolean isScript(String name) Description copied from interface:VFSFileProviderChecks if the FQ name can be resolved to a script by this provider.- Specified by:
- isScriptin interface- VFSFileProvider
- Returns:
 
 - 
isAbsolutepublic static boolean isAbsolute(String path) Returns if this path is absolute, i.e. if it starts with the path separator. So A#/a/b/c is absolute, A#b/c is not.
 An absolute path contains enough information to find the file. A relative path does not. This will compare them ignoring schemes.- Parameters:
- path-
- Returns:
 
 - 
getRealPathprotected String getRealPath(String path) Resolves this against any current directory and returns the unqualified *relative* path against the store's root path.- Parameters:
- path-
- Returns:
 
 - 
getStoreRootpublic String getStoreRoot() The root fo this store. So if the scheme is A and the mount point is /a/b/c then this returns A#/a/b/c. Operations on the store typiclly use this for resolving paths.- Returns:
 
 - 
getpublic VFSEntry get(String path, int type) throws Throwable Description copied from interface:VFSFileProviderGet the named item. Note that all of the names are qualified.- Specified by:
- getin interface- VFSFileProvider
- Returns:
- Throws:
- Throwable
 
 - 
putpublic void put(String newPath, VFSEntry entry) throws Throwable Description copied from interface:VFSFileProviderAdd the using the path. If and entry exists there it will be over-written.- Specified by:
- putin interface- VFSFileProvider
- Throws:
- Throwable
 
 - 
putpublic void put(VFSEntry entry) throws Throwable Description copied from interface:VFSFileProviderPut this in the store at its current path- Specified by:
- putin interface- VFSFileProvider
- Throws:
- Throwable
 
 - 
deletepublic void delete(String path) throws Throwable Description copied from interface:VFSFileProviderA delete is a type of write. If the store is not writeable, it cannot delete files.- Specified by:
- deletein interface- VFSFileProvider
- Throws:
- Throwable
 
 - 
containspublic boolean contains(String path) throws Throwable Description copied from interface:VFSFileProviderContains is a type of read. If the store is not readable, it cannot tell if it contains an entry.- Specified by:
- containsin interface- VFSFileProvider
- Returns:
- Throws:
- Throwable
 
 - 
dirpublic String[] dir(String path) throws Throwable - Specified by:
- dirin interface- VFSFileProvider
- Throws:
- Throwable
 
 - 
isDirectorypublic boolean isDirectory(String path) - Specified by:
- isDirectoryin interface- VFSFileProvider
 
 - 
isChildOfprotected boolean isChildOf(String[] top, String target, boolean isRoot) Use this for stores that keep everything in a flat list (like a database table or hash map of file paths.) You useVFSPaths.toPathComponents(String)on the argument to thedir(String)command and specify if it is the root node (since figuring that out is store dependent). This then compares paths by lengths to give back the right one.- Parameters:
- top-
- target-
- isRoot-
- Returns:
 
 - 
mkdirpublic boolean mkdir(String path) Description copied from interface:VFSFileProviderMake a set of directories. This will make a given directory and any intermediate directories.- Specified by:
- mkdirin interface- VFSFileProvider
- Returns:
 
 - 
rmdirpublic boolean rmdir(String path) throws Throwable Description copied from interface:VFSFileProviderThis will remove a directory. Note that this requires that the directory be empty of all files.- Specified by:
- rmdirin interface- VFSFileProvider
- Returns:
- Throws:
- Throwable
 
 - 
rmpublic void rm(String path) throws Throwable Description copied from interface:VFSFileProviderRemove a file from the store.- Specified by:
- rmin interface- VFSFileProvider
- Throws:
- Throwable
 
 - 
easSupportedpublic boolean easSupported() Description copied from interface:VFSFileProviderIf this store supports extended attributes.- Specified by:
- easSupportedin interface- VFSFileProvider
- Returns:
 
 - 
lengthpublic long length(String path) throws Throwable - Specified by:
- lengthin interface- VFSFileProvider
- Throws:
- Throwable
 
 
- 
 
-