public class JournalingFileSystem extends atg.vfs.VirtualFileSystemImpl implements VirtualFileSystem
The journal can be used for various applications. One straightforward use of the journal is a VFS recovery feature. An application can journal VFS operations and then later undo the operations. For a large VFS with many files this would be more efficient than simple saving a copy of the entire virtual file system. Another example is VFS mirroring. A journaling file system could be used to track changes to one master virtual file systems and then later replay those changes against one or more slave virtual file systems.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
| Constructor and Description |
|---|
JournalingFileSystem(VirtualFileSystem pUnderlyingFileSystem,
java.io.File pJournalDirectory)
Construct a journaling file system for the underlying
VFS using the specified directory to store the journal.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the journal used by this file system.
|
protected void |
finalize()
Close journal when we are GCed
|
VirtualFileSystemDescriptor |
getDescriptor()
Get the descriptor for this file system.
|
VirtualFile |
getFile(java.lang.String pPath)
Get the specified virtual file
|
VirtualFile |
getFile(atg.vfs.VirtualPath pPath)
Get the specified virtual file
|
Journal |
getJournal()
Get property
journal. |
java.io.File |
getJournalDirectory()
Get property
journalDirectory. |
boolean |
getJournalFileContent()
Get property
journalFileContent. |
atg.vfs.owner.OwnerCache |
getOwnerCache()
OwnerCache
|
VirtualFileSystem |
getUnderlyingFileSystem()
Get property
underlyingFileSystem. |
java.lang.String |
getVFSName()
Get property
VFSName. |
void |
open()
Open or create the journal used by this file system.
|
java.lang.String |
separator()
Get the directory separator for this filesystem
|
void |
setJournalFileContent(boolean pJournalFileContent)
Set property
journalFileContent. |
void |
setOwnerCache(atg.vfs.owner.OwnerCache pOwnerCache) |
void |
setVFSName(java.lang.String pVFSName)
Set property
VFSName. |
java.lang.String |
toString()
Get a string representation of this object
|
addUpdateListener, createDescriptor, deleteAllBeforeDate, deleteAllBeforeDate, deleteAllFiles, deleteOldEmptyFolders, getChecksumCache, getDefaultName, getLogger, getUpdateListeners, handleUpdate, removeUpdateListener, setChecksumCache, setDescriptor, setLogger, setUpdateListenersclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waithandleUpdatepublic JournalingFileSystem(VirtualFileSystem pUnderlyingFileSystem, java.io.File pJournalDirectory) throws JournalException
pUnderlyingFileSystem - VFS to wrap and journalpJournalDirectory - directory to use to hold journal. This must be
non null and refer to a directory that is readable and writable. Any
data that already exists in the directory will be deleted.JournalException - if there is a problem creating the file systempublic void setVFSName(java.lang.String pVFSName)
VFSName. This is
the name of this file systemsetVFSName in class atg.vfs.VirtualFileSystemImplpVFSName - new value to setpublic java.lang.String getVFSName()
VFSName. This is
the name of this file systemgetVFSName in interface VirtualFileSystemgetVFSName in class atg.vfs.VirtualFileSystemImplVFSNamepublic VirtualFileSystem getUnderlyingFileSystem()
underlyingFileSystem. This is the
underlying VFS to which all operations are relayed.UnderlyingFileSystempublic java.io.File getJournalDirectory()
journalDirectory. This is the
directory to hold the journal of changes made to the underlying VFS.journalDirectorypublic Journal getJournal()
journal. This is
the journal of modifications.journalpublic void setJournalFileContent(boolean pJournalFileContent)
journalFileContent. This is a flag which, if
true indicates that the contents of journaled files should
also be journaled. If this property is false then file
operations are still logged in the journal, but the contents of files
modified is not journaled. The false setting reduces the
overhead of journaling for callers who do not need to journal
content. The default value is false.pJournalFileContent - new value to setpublic boolean getJournalFileContent()
journalFileContent. This is a flag which, if
true indicates that the contents of journaled files should
also be journaled. If this property is false then file
operations are still logged in the journal, but the contents of files
modified is not journaled. The false setting reduces the
overhead of journaling for callers who do not need to journal
content. The default value is false.journalFileContentpublic VirtualFileSystemDescriptor getDescriptor()
getDescriptor in interface VirtualFileSystemgetDescriptor in class atg.vfs.VirtualFileSystemImplpublic VirtualFile getFile(java.lang.String pPath)
getFile in interface VirtualFileSystemgetFile in class atg.vfs.VirtualFileSystemImplpPath - path of virtual filepublic VirtualFile getFile(atg.vfs.VirtualPath pPath)
getFile in interface VirtualFileSystempPath - path of virtual filepublic java.lang.String separator()
separator in interface VirtualFileSystempublic void open()
throws JournalException
JournalException - if there is a journaling problempublic void close()
throws JournalException
JournalException - if there is a journaling problempublic void setOwnerCache(atg.vfs.owner.OwnerCache pOwnerCache)
setOwnerCache in interface atg.vfs.owner.OwnerCacheFileSystemsetOwnerCache in class atg.vfs.VirtualFileSystemImplpublic atg.vfs.owner.OwnerCache getOwnerCache()
getOwnerCache in interface atg.vfs.owner.OwnerCacheFileSystemgetOwnerCache in class atg.vfs.VirtualFileSystemImplprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.lang.String toString()
toString in class java.lang.Object