|
||||||||||
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 String |
TABLE_SPACE_VARIABLE
the variable for the Oracle table space |
protected 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. Overridden in order to support multiple oracle schemas. |
protected Blob |
createTemporaryBlob(InputStream in)
Creates a temporary oracle.sql.BLOB instance via reflection and spools the contents of the specified stream. |
protected void |
freeTemporaryBlob(Object blob)
Frees a temporary oracle.sql.BLOB instance via reflection. |
OutputStream |
getOutputStream(String filePath)
Returns an output stream for writing bytes to the file denoted by this path. The file will be created if it doesn't exist. If the file exists, its contents will be overwritten. Overridden because we need to use oracle.sql.BLOB
and PreparedStatement#setBlob instead of just
PreparedStatement#setBinaryStream . |
RandomAccessOutputStream |
getRandomAccessOutputStream(String filePath)
Returns an output stream for writing bytes to the file denoted by this path. The file will be created if it doesn't exist. The current position of the file pointer is set to 0 . See also
RandomAccessOutputStream.seek(long) ; |
String |
getTableSpace()
Returns the configured Oracle table space. |
void |
init()
Initialize the file system Retrieve the oracle.sql.BLOB class via reflection, and
initialize the values for the DURATION_SESSION and
MODE_READWRITE constants defined there. |
void |
setTableSpace(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, closeStream, 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 String TABLE_SPACE_VARIABLE
protected String tableSpace
Constructor Detail |
---|
public OracleFileSystem()
OracleFileSystem
instance.
Method Detail |
---|
public String getTableSpace()
public void setTableSpace(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 FileSystem
init
in class DatabaseFileSystem
FileSystemException
- if the file system initialization failsoracle.sql.BLOB#DURATION_SESSION
,
oracle.sql.BLOB#MODE_READWRITE
protected void checkSchema() throws Exception
checkSchema
in class DatabaseFileSystem
Exception
- if an error occursprotected void buildSQLStatements()
buildSQLStatements
in class DatabaseFileSystem
public OutputStream getOutputStream(String filePath) throws FileSystemException
oracle.sql.BLOB
and PreparedStatement#setBlob
instead of just
PreparedStatement#setBinaryStream
.
getOutputStream
in interface FileSystem
getOutputStream
in class DatabaseFileSystem
filePath
- the path of the file.
FileSystemException
- if the file cannot be written to or createdpublic RandomAccessOutputStream getRandomAccessOutputStream(String filePath) throws FileSystemException, UnsupportedOperationException
0
. See also
RandomAccessOutputStream.seek(long)
;
getRandomAccessOutputStream
in interface FileSystem
getRandomAccessOutputStream
in class DatabaseFileSystem
filePath
- the path of the file.
FileSystemException
- if the file could not be created or
if the output stream cannot be obtained.
UnsupportedOperationException
- if the implementation does
not support file access through a
RandomAccessOutputStream
.protected Blob createTemporaryBlob(InputStream in) throws Exception
Exception
protected void freeTemporaryBlob(Object blob) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |