|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.portal.cms.hibernate.HibernateStore
This is a FileSystem store using Hibernate, built on the DBFilesystem class packaged with Apache Jackrabbit that persists file system entries in a database table.
The required schema is created by hibernate using the portal datasource. Configuration of this store should look like this:<FileSystem class="org.jboss.portal.cms.hibernate.HibernateStore"> <param name="datasource" value="java:/PortalDS"/> <param name="isolation" value="2"/> <param name="batch_size" value="0"/> <param name="auto" value="update"/> <param name="provider_class" value="org.hibernate.cache.HashtableCacheProvider"/> <param name="schemaObjectPrefix" value="VersionEntry|CMSEntry|RepositoryEntry"/> </FileSystem>
Nested Class Summary | |
static class |
HibernateStore.BlobInputStream
|
Field Summary | |
protected java.lang.String |
deleteFileStmt
|
protected java.lang.String |
deleteFolderStmt
|
protected static int |
INITIAL_BUFFER_SIZE
|
protected boolean |
initialized
|
protected java.lang.String |
insertFileStmt
|
protected java.lang.String |
schemaObjectPrefix
|
protected java.lang.String |
selectChildCountStmt
|
protected java.lang.String |
selectDataStmt
|
protected java.lang.String |
selectExistStmt
|
protected java.lang.String |
selectFileExistStmt
|
protected java.lang.String |
selectFolderExistStmt
|
protected java.lang.String |
selectLastModifiedStmt
|
protected java.lang.String |
selectLengthStmt
|
Fields inherited from interface org.apache.jackrabbit.core.fs.FileSystem |
SEPARATOR, SEPARATOR_CHAR |
Constructor Summary | |
HibernateStore()
Default constructor |
Method Summary | |
protected void |
checkSchema()
Checks if the required schema objects exist and creates them if they don't exist yet. |
void |
close()
|
void |
copy(java.lang.String srcPath,
java.lang.String destPath)
|
protected void |
copyDeepFolder(java.lang.String srcPath,
java.lang.String destPath)
Recursively copies the given folder to the given destination. |
protected void |
copyFile(java.lang.String srcPath,
java.lang.String destPath)
Copies the given file entry to the given destination path. |
protected void |
createDeepFolder(java.lang.String folderPath)
Creates the specified files system folder entry, recursively creating any non-existing intermediate folder entries. |
void |
createFolder(java.lang.String folderPath)
Creates a folder and recursively all sub-folders in between |
void |
deleteFile(java.lang.String filePath)
|
void |
deleteFolder(java.lang.String folderPath)
|
boolean |
exists(java.lang.String path)
|
java.io.InputStream |
getInputStream(java.lang.String filePath)
|
java.lang.String |
getJNDIName()
|
java.io.OutputStream |
getOutputStream(java.lang.String filePath)
|
org.apache.jackrabbit.core.fs.RandomAccessOutputStream |
getRandomAccessOutputStream(java.lang.String filePath)
|
java.lang.String |
getSchemaObjectPrefix()
|
boolean |
hasChildren(java.lang.String path)
|
void |
init()
|
boolean |
isFile(java.lang.String path)
|
boolean |
isFolder(java.lang.String path)
|
long |
lastModified(java.lang.String path)
|
long |
length(java.lang.String filePath)
|
java.lang.String[] |
list(java.lang.String folderPath)
|
java.lang.String[] |
listFiles(java.lang.String folderPath)
|
java.lang.String[] |
listFolders(java.lang.String folderPath)
|
void |
move(java.lang.String srcPath,
java.lang.String destPath)
|
void |
setJNDIName(java.lang.String JNDIName)
|
void |
setSchemaObjectPrefix(java.lang.String schemaObjectPrefix)
|
void |
touch(java.lang.String filePath)
|
protected void |
verifyRootExists()
Verifies that the root file system entry exists. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean initialized
protected java.lang.String schemaObjectPrefix
protected static final int INITIAL_BUFFER_SIZE
protected java.lang.String selectExistStmt
protected java.lang.String selectFolderExistStmt
protected java.lang.String selectFileExistStmt
protected java.lang.String selectChildCountStmt
protected java.lang.String selectDataStmt
protected java.lang.String selectLastModifiedStmt
protected java.lang.String selectLengthStmt
protected java.lang.String deleteFileStmt
protected java.lang.String deleteFolderStmt
protected java.lang.String insertFileStmt
Constructor Detail |
public HibernateStore()
Method Detail |
public java.lang.String getSchemaObjectPrefix()
public void setSchemaObjectPrefix(java.lang.String schemaObjectPrefix)
public java.lang.String getJNDIName()
public void setJNDIName(java.lang.String JNDIName)
public void init() throws org.apache.jackrabbit.core.fs.FileSystemException
init
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public void close() throws org.apache.jackrabbit.core.fs.FileSystemException
close
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public void createFolder(java.lang.String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
createFolder
in interface org.apache.jackrabbit.core.fs.FileSystem
folderPath
- the path of the folder to create
org.apache.jackrabbit.core.fs.FileSystemException
- if the folder cannot be created or if the folder already existspublic void deleteFile(java.lang.String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
deleteFile
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public void deleteFolder(java.lang.String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
deleteFolder
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public boolean exists(java.lang.String path) throws org.apache.jackrabbit.core.fs.FileSystemException
exists
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public boolean isFile(java.lang.String path) throws org.apache.jackrabbit.core.fs.FileSystemException
isFile
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public boolean isFolder(java.lang.String path) throws org.apache.jackrabbit.core.fs.FileSystemException
isFolder
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public long lastModified(java.lang.String path) throws org.apache.jackrabbit.core.fs.FileSystemException
lastModified
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public long length(java.lang.String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
length
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public boolean hasChildren(java.lang.String path) throws org.apache.jackrabbit.core.fs.FileSystemException
hasChildren
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public java.lang.String[] list(java.lang.String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
list
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public java.lang.String[] listFiles(java.lang.String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
listFiles
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public java.lang.String[] listFolders(java.lang.String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
listFolders
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public void touch(java.lang.String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
touch
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public java.io.InputStream getInputStream(java.lang.String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
getInputStream
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public java.io.OutputStream getOutputStream(java.lang.String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException
getOutputStream
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public org.apache.jackrabbit.core.fs.RandomAccessOutputStream getRandomAccessOutputStream(java.lang.String filePath) throws org.apache.jackrabbit.core.fs.FileSystemException, java.lang.UnsupportedOperationException
getRandomAccessOutputStream
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
java.lang.UnsupportedOperationException
public void copy(java.lang.String srcPath, java.lang.String destPath) throws org.apache.jackrabbit.core.fs.FileSystemException
copy
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
public void move(java.lang.String srcPath, java.lang.String destPath) throws org.apache.jackrabbit.core.fs.FileSystemException
move
in interface org.apache.jackrabbit.core.fs.FileSystem
org.apache.jackrabbit.core.fs.FileSystemException
protected void checkSchema() throws java.lang.Exception
java.lang.Exception
- if an error occursprotected void verifyRootExists() throws java.lang.Exception
java.lang.Exception
- if an error occursprotected void createDeepFolder(java.lang.String folderPath) throws org.apache.jackrabbit.core.fs.FileSystemException
folderPath
- folder entry to create
org.apache.jackrabbit.core.fs.FileSystemException
- if an error occursprotected void copyDeepFolder(java.lang.String srcPath, java.lang.String destPath) throws org.apache.jackrabbit.core.fs.FileSystemException
srcPath
- folder to be copieddestPath
- destination path to which the folder is to be copied
org.apache.jackrabbit.core.fs.FileSystemException
- if an error occursprotected void copyFile(java.lang.String srcPath, java.lang.String destPath) throws org.apache.jackrabbit.core.fs.FileSystemException
srcPath
- file to be copieddestPath
- destination path to which the file is to be copied
org.apache.jackrabbit.core.fs.FileSystemException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |