|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.com.prunge.jgenfile.impl.AbstractOperation | +--au.com.prunge.jgenfile.impl.AbstractItemOperation | +--au.com.prunge.jgenfile.impl.local.LocalDeleteItemOperation
An operation that deletes an item on the local file system.
Constructor Summary | |
LocalDeleteItemOperation(LocalItem item)
Constructs a LocalDeleteItemOperation . |
Method Summary | |
void |
abort()
Aborts the operation if it is currently running. |
int |
getDeletedFilesCount()
Returns the number of files that were deleted by this operation. |
float |
getProgress()
Returns the progress of this operation. |
protected void |
recursiveDelete(File file,
Set nonDeletedReferenceSet)
Recursively deletes all children of this file and then the file itself. |
void |
runImpl()
The actual run() implementation goes in this method. |
Methods inherited from class au.com.prunge.jgenfile.impl.AbstractItemOperation |
getItem |
Methods inherited from class au.com.prunge.jgenfile.impl.AbstractOperation |
addOperationHints, checkRun, getLastRunException, getOperationHint, getOperationHints, hasRun, run, setLastRunException, setOperationHint, setOperationHints |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface au.com.prunge.jgenfile.DeleteItemOperation |
run |
Methods inherited from interface au.com.prunge.jgenfile.ItemOperation |
getItem |
Methods inherited from interface au.com.prunge.jgenfile.Operation |
addOperationHints, getLastRunException, getOperationHint, getOperationHints, hasRun, setOperationHint, setOperationHints |
Constructor Detail |
public LocalDeleteItemOperation(LocalItem item)
LocalDeleteItemOperation
.
item
- the item to delete.Method Detail |
public int getDeletedFilesCount() throws OperationNotFinishedException, JGenFileException
DeleteItemOperation
This number is only useful if the item that was deleted was a directory and contained other items.
getDeletedFilesCount
in interface DeleteItemOperation
JGenFileException
- if another error occurs.
OperationNotFinishedException
- if this method
was called and the run() method has not
finished or has not been called.DeleteItemOperation.getDeletedFilesCount()
public float getProgress()
getProgress
in interface ProgressObservable
public void runImpl() throws JGenFileException, PartialDeleteException
AbstractOperation
If this method completes successfully (i.e. without throwing an exception), the last run exception is set to null indicating no exception occurred and subsequent calls to hasRun() will return true.
If this method throws an exception, the last run exception is filled in and hasRun() subsequent calls to hasRun() will return false.
runImpl
in class AbstractOperation
JGenFileException
- if an error occurs.
PartialDeleteException
DeleteItemOperation.run()
protected void recursiveDelete(File file, Set nonDeletedReferenceSet) throws JGenFileException
file
- the file to delete.
JGenFileException
- if one or more files could
not be deleted.public void abort()
Operation
This method should be executed in different thread than the one executing the run method. Operations do not have to immediately abort, but rather should make a best effort to end any long-running operations. When an operation finally does abort, the run method will return, perhaps not comleting all its required work. If this happens, an OperationAbortedException should be thrown.
An aborted operation should not leave the file system in an unstable state. All operations should tie up any loose ends before aborting.
This method could be called in response to a cancel button being pressed.
abort
in interface Operation
abort
in class AbstractOperation
Operation.abort()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |