public abstract class DatabaseFileSystem extends Object implements org.apache.jackrabbit.core.fs.FileSystem
See the DbFileSystem for a detailed description of the available
configuration options and database behaviour.
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.jackrabbit.core.util.db.ConnectionHelper |
conHelper
the
ConnectionHelper set in the init() method |
protected String |
copyFileSQL |
protected String |
copyFilesSQL |
protected String |
deleteFileSQL |
protected String |
deleteFolderSQL |
protected static int |
INITIAL_BUFFER_SIZE |
protected boolean |
initialized |
protected String |
insertFileSQL |
protected String |
insertFolderSQL |
protected String |
schema |
protected String |
schemaObjectPrefix |
protected String |
selectChildCountSQL |
protected String |
selectDataSQL |
protected String |
selectExistSQL |
protected String |
selectFileAndFolderNamesSQL |
protected String |
selectFileExistSQL |
protected String |
selectFileNamesSQL |
protected String |
selectFolderExistSQL |
protected String |
selectFolderNamesSQL |
protected String |
selectLastModifiedSQL |
protected String |
selectLengthSQL |
protected String |
updateDataSQL |
protected String |
updateLastModifiedSQL |
| Constructor and Description |
|---|
DatabaseFileSystem()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildSQLStatements()
Builds the SQL statements
|
void |
close() |
protected org.apache.jackrabbit.core.util.db.CheckSchemaOperation |
createCheckSchemaOperation()
This method is called from
init() after the
createConnectionHelper(DataSource) method, and returns a default CheckSchemaOperation. |
protected org.apache.jackrabbit.core.util.db.ConnectionHelper |
createConnectionHelper(DataSource dataSrc)
This method is called from the
init() method of this class and returns a
ConnectionHelper instance which is assigned to the conHelper field. |
protected void |
createDeepFolder(String folderPath)
Creates the specified files system folder entry, recursively creating
any non-existing intermediate folder entries.
|
void |
createFolder(String folderPath) |
void |
deleteFile(String filePath) |
void |
deleteFolder(String folderPath) |
boolean |
equals(Object obj) |
boolean |
exists(String path) |
protected abstract DataSource |
getDataSource() |
InputStream |
getInputStream(String filePath) |
OutputStream |
getOutputStream(String filePath) |
String |
getSchema() |
String |
getSchemaObjectPrefix() |
boolean |
hasChildren(String path) |
int |
hashCode()
Returns zero to satisfy the Object equals/hashCode contract.
|
void |
init() |
boolean |
isFile(String path) |
boolean |
isFolder(String path) |
boolean |
isSchemaCheckEnabled() |
long |
lastModified(String path) |
long |
length(String filePath) |
String[] |
list(String folderPath) |
String[] |
listFiles(String folderPath) |
String[] |
listFolders(String folderPath) |
void |
setSchema(String schema) |
void |
setSchemaCheckEnabled(boolean enabled) |
void |
setSchemaObjectPrefix(String schemaObjectPrefix) |
protected void |
verifyRootExists()
Verifies that the root file system entry exists.
|
protected boolean initialized
protected String schema
protected String schemaObjectPrefix
protected static final int INITIAL_BUFFER_SIZE
protected org.apache.jackrabbit.core.util.db.ConnectionHelper conHelper
ConnectionHelper set in the init() methodprotected String selectExistSQL
protected String selectFileExistSQL
protected String selectFolderExistSQL
protected String selectChildCountSQL
protected String selectDataSQL
protected String selectLastModifiedSQL
protected String selectLengthSQL
protected String selectFileNamesSQL
protected String selectFolderNamesSQL
protected String selectFileAndFolderNamesSQL
protected String deleteFileSQL
protected String deleteFolderSQL
protected String insertFileSQL
protected String insertFolderSQL
protected String updateDataSQL
protected String updateLastModifiedSQL
protected String copyFileSQL
protected String copyFilesSQL
public String getSchemaObjectPrefix()
public void setSchemaObjectPrefix(String schemaObjectPrefix)
public String getSchema()
public void setSchema(String schema)
public final boolean isSchemaCheckEnabled()
public final void setSchemaCheckEnabled(boolean enabled)
enabled - set whether the schema check is enabledpublic int hashCode()
hashCode in class ObjectObject.hashCode()public void init()
throws org.apache.jackrabbit.core.fs.FileSystemException
init in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionprotected abstract DataSource getDataSource() throws Exception
Exceptionprotected org.apache.jackrabbit.core.util.db.ConnectionHelper createConnectionHelper(DataSource dataSrc) throws Exception
init() method of this class and returns a
ConnectionHelper instance which is assigned to the conHelper field. Subclasses may
override it to return a specialized connection helper.dataSrc - the DataSource of this persistence managerConnectionHelperException - on errorprotected org.apache.jackrabbit.core.util.db.CheckSchemaOperation createCheckSchemaOperation()
init() after the
createConnectionHelper(DataSource) method, and returns a default CheckSchemaOperation.
Subclasses can overrride this implementation to get a customized implementation.CheckSchemaOperation instancepublic void close()
throws org.apache.jackrabbit.core.fs.FileSystemException
close in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic void createFolder(String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
createFolder in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic void deleteFile(String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
deleteFile in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic void deleteFolder(String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
deleteFolder in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic boolean exists(String path) throws org.apache.jackrabbit.core.fs.FileSystemException
exists in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic boolean isFile(String path) throws org.apache.jackrabbit.core.fs.FileSystemException
isFile in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic boolean isFolder(String path) throws org.apache.jackrabbit.core.fs.FileSystemException
isFolder in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic long lastModified(String path) throws org.apache.jackrabbit.core.fs.FileSystemException
lastModified in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic long length(String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
length in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic boolean hasChildren(String path) throws org.apache.jackrabbit.core.fs.FileSystemException
hasChildren in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic String[] list(String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
list in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic String[] listFiles(String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
listFiles in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic String[] listFolders(String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
listFolders in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic InputStream getInputStream(String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
getInputStream in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionpublic OutputStream getOutputStream(String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
getOutputStream in interface org.apache.jackrabbit.core.fs.FileSystemorg.apache.jackrabbit.core.fs.FileSystemExceptionprotected void buildSQLStatements()
protected void verifyRootExists()
throws Exception
Exception - if an error occursprotected void createDeepFolder(String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
folderPath - folder entry to createorg.apache.jackrabbit.core.fs.FileSystemException - if an error occursCopyright © 2004–2018 The Apache Software Foundation. All rights reserved.