|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.fs.db.DatabaseFileSystem
org.apache.jackrabbit.core.fs.db.DbFileSystem
org.apache.jackrabbit.core.fs.db.OracleFileSystem
public class OracleFileSystem
OracleFileSystem is a JDBC-based FileSystem
implementation for Jackrabbit that persists file system entries in an
Oracle database.
driver: the FQN name of the JDBC driver class
(default: "oracle.jdbc.OracleDriver")schema: type of schema to be used
(default: "oracle")url: the database url (e.g.
"jdbc:oracle:thin:@[host]:[port]:[sid]")user: the database userpassword: the user's passwordschemaObjectPrefix: prefix to be prepended to schema objectstableSpace: the tablespace to useDbFileSystem.
The following is a fragment from a sample configuration:
<FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
<param name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl"/>
<param name="user" value="scott"/>
<param name="password" value="tiger"/>
<param name="schemaObjectPrefix" value="rep_"/>
<param name="tableSpace" value="default"/>
</FileSystem>
| Field Summary | |
|---|---|
static java.lang.String |
TABLE_SPACE_VARIABLE
the variable for the Oracle table space |
protected java.lang.String |
tableSpace
the Oracle table space to use |
| Fields inherited from class org.apache.jackrabbit.core.fs.db.DbFileSystem |
|---|
driver, password, url, user |
| Fields inherited from class org.apache.jackrabbit.core.fs.db.DatabaseFileSystem |
|---|
con, copyFileSQL, copyFilesSQL, deleteFileSQL, deleteFolderSQL, INITIAL_BUFFER_SIZE, initialized, insertFileSQL, insertFolderSQL, schema, SCHEMA_OBJECT_PREFIX_VARIABLE, schemaObjectPrefix, selectChildCountSQL, selectDataSQL, selectExistSQL, selectFileAndFolderNamesSQL, selectFileExistSQL, selectFileNamesSQL, selectFolderExistSQL, selectFolderNamesSQL, selectLastModifiedSQL, selectLengthSQL, SLEEP_BEFORE_RECONNECT, updateDataSQL, updateLastModifiedSQL |
| Fields inherited from interface org.apache.jackrabbit.core.fs.FileSystem |
|---|
SEPARATOR, SEPARATOR_CHAR |
| Constructor Summary | |
|---|---|
OracleFileSystem()
Creates a new OracleFileSystem instance. |
|
| Method Summary | |
|---|---|
protected void |
buildSQLStatements()
Builds the SQL statements Since Oracle treats emtpy strings and BLOBs as null values the SQL statements had to be adapated accordingly. |
protected void |
checkSchema()
Checks if the required schema objects exist and creates them if they don't exist yet. |
protected java.sql.Blob |
createTemporaryBlob(java.io.InputStream in)
Creates a temporary oracle.sql.BLOB instance via reflection and spools the contents of the specified stream. |
protected void |
freeTemporaryBlob(java.lang.Object blob)
Frees a temporary oracle.sql.BLOB instance via reflection. |
java.io.OutputStream |
getOutputStream(java.lang.String filePath)
Returns an output stream for writing bytes to the file denoted by this path. |
RandomAccessOutputStream |
getRandomAccessOutputStream(java.lang.String filePath)
Returns an output stream for writing bytes to the file denoted by this path. |
java.lang.String |
getTableSpace()
Returns the configured Oracle table space. |
void |
init()
Initialize the file system |
void |
setTableSpace(java.lang.String tableSpace)
Sets the Oracle table space. |
| Methods inherited from class org.apache.jackrabbit.core.fs.db.DbFileSystem |
|---|
equals, getConnection, getDriver, getPassword, getUrl, getUser, hashCode, setDriver, setPassword, setUrl, setUser |
| Methods inherited from class org.apache.jackrabbit.core.fs.db.DatabaseFileSystem |
|---|
close, closeConnection, closeResultSet, closeStatement, copy, copyDeepFolder, copyFile, createDeepFolder, createFolder, deleteFile, deleteFolder, executeStmt, exists, getInputStream, getSchema, getSchemaObjectPrefix, hasChildren, initConnection, initPreparedStatements, isFile, isFolder, lastModified, length, list, listFiles, listFolders, move, prepareSchemaObjectPrefix, reestablishConnection, resetStatement, setSchema, setSchemaObjectPrefix, touch, verifyRootExists |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TABLE_SPACE_VARIABLE
protected java.lang.String tableSpace
| Constructor Detail |
|---|
public OracleFileSystem()
OracleFileSystem instance.
| Method Detail |
|---|
public java.lang.String getTableSpace()
public void setTableSpace(java.lang.String tableSpace)
tableSpace - the Oracle table space.
public void init()
throws FileSystemException
oracle.sql.BLOB class via reflection, and
initialize the values for the DURATION_SESSION and
MODE_READWRITE constants defined there.
init in interface FileSysteminit in class DatabaseFileSystemFileSystemException - if the file system initialization failsoracle.sql.BLOB#DURATION_SESSION,
oracle.sql.BLOB#MODE_READWRITE
protected void checkSchema()
throws java.lang.Exception
checkSchema in class DatabaseFileSystemjava.lang.Exception - if an error occursprotected void buildSQLStatements()
buildSQLStatements in class DatabaseFileSystem
public java.io.OutputStream getOutputStream(java.lang.String filePath)
throws FileSystemException
oracle.sql.BLOB
and PreparedStatement#setBlob instead of just
PreparedStatement#setBinaryStream.
getOutputStream in interface FileSystemgetOutputStream in class DatabaseFileSystemfilePath - the path of the file.
FileSystemException - if the file cannot be written to or created
public RandomAccessOutputStream getRandomAccessOutputStream(java.lang.String filePath)
throws FileSystemException,
java.lang.UnsupportedOperationException
0. See also
RandomAccessOutputStream.seek(long);
getRandomAccessOutputStream in interface FileSystemgetRandomAccessOutputStream in class DatabaseFileSystemfilePath - the path of the file.
FileSystemException - if the file could not be created or
if the output stream cannot be obtained.
java.lang.UnsupportedOperationException - if the implementation does
not support file access through a
RandomAccessOutputStream.
protected java.sql.Blob createTemporaryBlob(java.io.InputStream in)
throws java.lang.Exception
java.lang.Exception
protected void freeTemporaryBlob(java.lang.Object blob)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||