Class OracleFileSystem

  • All Implemented Interfaces:
    FileSystem, DatabaseAware
    Direct Known Subclasses:
    Oracle9FileSystem

    public class OracleFileSystem
    extends DbFileSystem
    OracleFileSystem is a JDBC-based FileSystem implementation for Jackrabbit that persists file system entries in an Oracle database.

    It is configured through the following properties:

    • 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 user
    • password: the user's password
    • schemaObjectPrefix: prefix to be prepended to schema objects
    • tablespace: the tablespace to use for tables (also used for indexes if indexTablespace is omitted)
    • indexTablespace: the tablespace to use for indexes
    See also DbFileSystem.

    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="user"/>
           <param name="indexTablespace" value="user"/>
      </FileSystem>
     
    • Constructor Detail

      • OracleFileSystem

        public OracleFileSystem()
        Creates a new OracleFileSystem instance.
    • Method Detail

      • getTablespace

        public String getTablespace()
        Returns the configured Oracle tablespace for tables.
        Returns:
        the configured Oracle tablespace for tables.
      • setTablespace

        public void setTablespace​(String tablespaceName)
        Sets the Oracle tablespace for tables.
        Parameters:
        tablespaceName - the Oracle tablespace for tables.
      • getIndexTablespace

        public String getIndexTablespace()
        Returns the configured Oracle tablespace for indexes.
        Returns:
        the configured Oracle tablespace for indexes.
      • setIndexTablespace

        public void setIndexTablespace​(String tablespaceName)
        Sets the Oracle tablespace for indexes.
        Parameters:
        tablespaceName - the Oracle tablespace for indexes.
      • buildSQLStatements

        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. The following changes were necessary:

        • The distinction between file and folder entries is based on FSENTRY_LENGTH being null/not null rather than FSENTRY_DATA being null/not null because FSENTRY_DATA of a 0-length (i.e. empty) file is null in Oracle.
        • Folder entries: Since the root folder has an empty name (which would be null in Oracle), an empty name is automatically converted and treated as " ".
        Overrides:
        buildSQLStatements in class DatabaseFileSystem