public class UndoableVfs extends AbstractVfs
To use, you must start a transaction using startTransaction(), then end it with endTransaction(). The latter returns an Undoable you can store.
The implementation is based on storing changes in a subdirectory of the VFS. This allows efficient moves and copies. By default this subdirectory is archive/vfs.
Copyright 2009-2012 Partner Software, Inc.
| Constructor and Description |
|---|
UndoableVfs(Vfs vfs) |
UndoableVfs(Vfs vfs,
Path archivePath) |
UndoableVfs(Vfs vfs,
java.lang.String archivePath) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearTransactions() |
VfsDirectory |
directoryFor(Path path)
Returns a VfsDirectory for the given path.
|
VfsDirectory |
directoryFor(java.lang.String pathString)
Returns a VfsDirectory for the given path.
|
java.lang.String |
endTransaction()
Ends a file modification transaction.
|
VfsFile |
fileFor(Path path)
Returns a VfsFile for the given path.
|
VfsFile |
fileFor(java.lang.String pathString)
Returns a VfsFile for the given path string.
|
Path |
getAbsolutePath()
Absolute path to the root of this Vfs.
|
boolean |
inTransaction() |
boolean |
isTransactionNode(VfsNode node) |
boolean |
isWritable()
True if this module supports writing.
|
java.util.List<java.lang.String> |
listRedoTransactions()
Lists the available transaction names in the redo queue, ordered from
oldest to newest by original transaction time.
|
java.util.List<java.lang.String> |
listUndoTransactions()
Lists the available transaction names in the undo queue, ordered from
newest to oldest by original transaction time.
|
void |
redo() |
void |
redo(java.lang.String transactionName)
Redoes the named transaction.
|
java.lang.String |
startTransaction()
Starts a file modification transaction.
|
void |
undo() |
void |
undo(java.lang.String transactionName)
Undoes the named transaction.
|
getBufferSize, getDisableOptimizations, getVerifyTransfers, setBufferSize, setDisableOptimizations, setVerifyTransferspublic UndoableVfs(Vfs vfs)
public UndoableVfs(Vfs vfs, java.lang.String archivePath)
public boolean isTransactionNode(VfsNode node)
public boolean inTransaction()
public java.lang.String startTransaction()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String endTransaction()
throws java.io.IOException
java.io.IOExceptionpublic java.util.List<java.lang.String> listUndoTransactions()
throws java.io.IOException
java.io.IOExceptionpublic java.util.List<java.lang.String> listRedoTransactions()
throws java.io.IOException
java.io.IOExceptionpublic void undo(java.lang.String transactionName)
throws java.io.IOException
java.io.IOExceptionpublic void redo(java.lang.String transactionName)
throws java.io.IOException
java.io.IOExceptionpublic void redo()
throws java.io.IOException
java.io.IOExceptionpublic void undo()
throws java.io.IOException
java.io.IOExceptionpublic void clearTransactions()
throws java.io.IOException
java.io.IOExceptionpublic VfsDirectory directoryFor(Path path)
Vfspath - to directorypublic VfsDirectory directoryFor(java.lang.String pathString)
VfspathString - string-encoded path to directorypublic VfsFile fileFor(Path path)
Vfspath - to filepublic VfsFile fileFor(java.lang.String pathString)
VfspathString - string-encoded path to filepublic Path getAbsolutePath()
Vfspublic boolean isWritable()
Vfs