Package org.apache.jackrabbit.core.fs.db
Class DerbyFileSystem
- java.lang.Object
-
- org.apache.jackrabbit.core.fs.db.DatabaseFileSystem
-
- org.apache.jackrabbit.core.fs.db.DbFileSystem
-
- org.apache.jackrabbit.core.fs.db.DerbyFileSystem
-
- All Implemented Interfaces:
FileSystem
,DatabaseAware
public class DerbyFileSystem extends DbFileSystem
DerbyFileSystem
is a JDBC-basedFileSystem
implementation for Jackrabbit that persists file system entries in an embedded Derby database.It is configured through the following properties:
url
: the database url of the form"jdbc:derby:[db];[attributes]"
schemaObjectPrefix
: prefix to be prepended to schema objectsdriver
: the FQN name of the JDBC driver class (default:"org.apache.derby.jdbc.EmbeddedDriver"
)schema
: type of schema to be used (default:"derby"
)user
: the database user (default:null
)password
: the user's password (default:null
)shutdownOnClose
: iftrue
(the default) the database is shutdown when the last connection is closed; set this tofalse
when using a standalone database
DbFileSystem
.The following is a fragment from a sample configuration:
<FileSystem class="org.apache.jackrabbit.core.fs.db.DerbyFileSystem"> <param name="url" value="jdbc:derby:${rep.home}/db;create=true"/> <param name="schemaObjectPrefix" value="rep_"/> </FileSystem>
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
shutdownOnClose
Flag indicating whether this derby database should be shutdown on close.-
Fields inherited from class org.apache.jackrabbit.core.fs.db.DbFileSystem
dataSourceName, driver, password, url, user
-
Fields inherited from class org.apache.jackrabbit.core.fs.db.DatabaseFileSystem
conHelper, copyFileSQL, copyFilesSQL, deleteFileSQL, deleteFolderSQL, INITIAL_BUFFER_SIZE, initialized, insertFileSQL, insertFolderSQL, schema, schemaObjectPrefix, selectChildCountSQL, selectDataSQL, selectExistSQL, selectFileAndFolderNamesSQL, selectFileExistSQL, selectFileNamesSQL, selectFolderExistSQL, selectFolderNamesSQL, selectLastModifiedSQL, selectLengthSQL, updateDataSQL, updateLastModifiedSQL
-
Fields inherited from interface org.apache.jackrabbit.core.fs.FileSystem
SEPARATOR, SEPARATOR_CHAR
-
-
Constructor Summary
Constructors Constructor Description DerbyFileSystem()
Creates a newDerbyFileSystem
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the file system.protected ConnectionHelper
createConnectionHelper(DataSource dataSrc)
This method is called from theDatabaseFileSystem.init()
method of this class and returns aConnectionHelper
instance which is assigned to theconHelper
field.boolean
getShutdownOnClose()
void
setShutdownOnClose(boolean shutdownOnClose)
-
Methods inherited from class org.apache.jackrabbit.core.fs.db.DbFileSystem
equals, getDataSource, getDataSourceName, getDriver, getPassword, getUrl, getUser, hashCode, setConnectionFactory, setDataSourceName, setDriver, setPassword, setUrl, setUser
-
Methods inherited from class org.apache.jackrabbit.core.fs.db.DatabaseFileSystem
buildSQLStatements, createCheckSchemaOperation, createDeepFolder, createFolder, deleteFile, deleteFolder, exists, getInputStream, getOutputStream, getSchema, getSchemaObjectPrefix, hasChildren, init, isFile, isFolder, isSchemaCheckEnabled, lastModified, length, list, listFiles, listFolders, setSchema, setSchemaCheckEnabled, setSchemaObjectPrefix, verifyRootExists
-
-
-
-
Method Detail
-
getShutdownOnClose
public boolean getShutdownOnClose()
-
setShutdownOnClose
public void setShutdownOnClose(boolean shutdownOnClose)
-
createConnectionHelper
protected ConnectionHelper createConnectionHelper(DataSource dataSrc) throws Exception
This method is called from theDatabaseFileSystem.init()
method of this class and returns aConnectionHelper
instance which is assigned to theconHelper
field. Subclasses may override it to return a specialized connection helper.- Overrides:
createConnectionHelper
in classDatabaseFileSystem
- Parameters:
dataSrc
- theDataSource
of this persistence manager- Returns:
- a
ConnectionHelper
- Throws:
Exception
- on error
-
close
public void close() throws FileSystemException
Close the file system. After calling this method, the file system is no longer accessible.- Specified by:
close
in interfaceFileSystem
- Overrides:
close
in classDatabaseFileSystem
- Throws:
FileSystemException
-
-