Package org.qdl_lang.vfs
Class VFSMySQLProvider
- java.lang.Object
-
- org.qdl_lang.vfs.AbstractVFSFileProvider
-
- org.qdl_lang.vfs.VFSMySQLProvider
-
- All Implemented Interfaces:
Serializable
,VFSFileProvider
public class VFSMySQLProvider extends AbstractVFSFileProvider
Created by Jeff Gaynor
on 2/28/20 at 7:17 AM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
FILENAME_INDEX
static int
PATH_INDEX
-
Constructor Summary
Constructors Constructor Description VFSMySQLProvider(VFSDatabase db, String scheme, String mountPoint, boolean canRead, boolean canWrite)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String path)
Contains is a type of read.void
delete(String path)
A delete is a type of write.String[]
dir(String path)
boolean
easSupported()
If this store supports extended attributes.VFSEntry
get(String path, int type)
Get the named item.protected String[]
getPrimaryKey(String path)
protected String
getRealPath(String path)
Resolves this against any current directory and returns the unqualified *relative* path against the store's root path.String
getType()
mostly this is so when information is being displayed to the user they can see the origin of the provider.boolean
isDirectory(String path)
boolean
mkdir(String path)
Make a set of directories.void
put(String path, VFSEntry entry)
Add the using the path.void
rm(String path)
Remove a file from the store.boolean
rmdir(String path)
Removes a directory if it is empty.-
Methods inherited from class org.qdl_lang.vfs.AbstractVFSFileProvider
canRead, canWrite, checkPath, checkScheme, getCurrentDir, getFileInfo, getMountPoint, getScheme, getStoreRoot, isAbsolute, isChildOf, isScript, length, put, setCurrentDir, setMountPoint, setRead, setScheme, setWrite, unqualifyPath
-
-
-
-
Constructor Detail
-
VFSMySQLProvider
public VFSMySQLProvider(VFSDatabase db, String scheme, String mountPoint, boolean canRead, boolean canWrite)
-
-
Method Detail
-
getRealPath
protected String getRealPath(String path)
Description copied from class:AbstractVFSFileProvider
Resolves this against any current directory and returns the unqualified *relative* path against the store's root path.- Overrides:
getRealPath
in classAbstractVFSFileProvider
- Returns:
-
get
public VFSEntry get(String path, int type) throws Throwable
Description copied from interface:VFSFileProvider
Get the named item. Note that all of the names are qualified.- Specified by:
get
in interfaceVFSFileProvider
- Overrides:
get
in classAbstractVFSFileProvider
- Returns:
- Throws:
Throwable
-
put
public void put(String path, VFSEntry entry) throws Throwable
Description copied from interface:VFSFileProvider
Add the using the path. If and entry exists there it will be over-written.- Specified by:
put
in interfaceVFSFileProvider
- Overrides:
put
in classAbstractVFSFileProvider
- Throws:
Throwable
-
delete
public void delete(String path) throws Throwable
Description copied from interface:VFSFileProvider
A delete is a type of write. If the store is not writeable, it cannot delete files.- Specified by:
delete
in interfaceVFSFileProvider
- Overrides:
delete
in classAbstractVFSFileProvider
- Throws:
Throwable
-
contains
public boolean contains(String path) throws Throwable
Description copied from interface:VFSFileProvider
Contains is a type of read. If the store is not readable, it cannot tell if it contains an entry.- Specified by:
contains
in interfaceVFSFileProvider
- Overrides:
contains
in classAbstractVFSFileProvider
- Returns:
- Throws:
Throwable
-
dir
public String[] dir(String path) throws Throwable
- Specified by:
dir
in interfaceVFSFileProvider
- Overrides:
dir
in classAbstractVFSFileProvider
- Throws:
Throwable
-
getType
public String getType()
Description copied from interface:VFSFileProvider
mostly this is so when information is being displayed to the user they can see the origin of the provider.- Returns:
-
mkdir
public boolean mkdir(String path)
Description copied from interface:VFSFileProvider
Make a set of directories. This will make a given directory and any intermediate directories.- Specified by:
mkdir
in interfaceVFSFileProvider
- Overrides:
mkdir
in classAbstractVFSFileProvider
- Returns:
-
rmdir
public boolean rmdir(String path) throws Throwable
Removes a directory if it is empty. If it is not empty, it or the directory cannot be removed, it returns false.- Specified by:
rmdir
in interfaceVFSFileProvider
- Overrides:
rmdir
in classAbstractVFSFileProvider
- Parameters:
path
-- Returns:
- Throws:
Throwable
-
rm
public void rm(String path) throws Throwable
Description copied from interface:VFSFileProvider
Remove a file from the store.- Specified by:
rm
in interfaceVFSFileProvider
- Overrides:
rm
in classAbstractVFSFileProvider
- Throws:
Throwable
-
easSupported
public boolean easSupported()
Description copied from interface:VFSFileProvider
If this store supports extended attributes.- Specified by:
easSupported
in interfaceVFSFileProvider
- Overrides:
easSupported
in classAbstractVFSFileProvider
- Returns:
-
isDirectory
public boolean isDirectory(String path)
- Specified by:
isDirectory
in interfaceVFSFileProvider
- Overrides:
isDirectory
in classAbstractVFSFileProvider
-
-