public final class DirectDirectoryDeleteTransaction
extends java.lang.Object
Constructor and Description |
---|
DirectDirectoryDeleteTransaction(java.io.File p_fileToDelete) |
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commit the transaction.
|
java.io.File |
getBackup() |
java.io.File |
getFileToDelete()
Get the source file.
|
java.lang.Throwable |
getLastError() |
boolean |
hasBackup() |
boolean |
process() |
boolean |
requestCommit()
Request a file system transaction.
|
boolean |
rollback()
Try to rollback the file transaction.
|
java.lang.String |
toString() |
public DirectDirectoryDeleteTransaction(java.io.File p_fileToDelete) throws java.io.IOException
p_fileToDelete
- java.io.IOException
public boolean requestCommit()
ITwoPhaseTransaction
When this method returns true
it has sucessfully moved the source
file to it's new location, and has successfully created a backup copy of the
destination file, if it existed before.
requestCommit
in interface ITwoPhaseTransaction
public boolean process()
public final java.io.File getFileToDelete()
p_fileSrc
that was passed to the contructor.public final boolean hasBackup()
hasBackup
in interface ITwoPhaseIOTransaction
true
if the transaction has left a backup file,
or false
otherwise (e.g. if the destination file
did not exist before the transaction).public final java.io.File getBackup()
getBackup
in interface ITwoPhaseIOTransaction
null
if none was created (e.g. if the destination
file did not exist before the transaction).public final void commit()
ITwoPhaseTransaction
commit
in interface ITwoPhaseTransaction
public boolean rollback()
rollback
in interface ITwoPhaseTransaction
true
if the rollback was successful, or false
otherwise. In the latter case ITwoPhaseTransaction.getLastError()
may give additional
information about why the rollback failed, and a backup file may exist then.public final java.lang.Throwable getLastError()
getLastError
in interface ITwoPhaseTransaction
null
if no error occurred;public java.lang.String toString()
toString
in class java.lang.Object