au.com.prunge.jgenfile
Interface DeleteItemOperation

All Superinterfaces:
ItemOperation, Operation
All Known Implementing Classes:
LocalDeleteItemOperation

public interface DeleteItemOperation
extends ItemOperation

An operation that deletes an item. If the item is a directory and the directory contains one or more items, they should also be deleted.

Version:
1.0
Author:
Peter Runge

Method Summary
 int getDeletedFilesCount()
          Returns the number of files that were deleted by this operation.
 void run()
          Runs this operation.
 
Methods inherited from interface au.com.prunge.jgenfile.ItemOperation
getItem
 
Methods inherited from interface au.com.prunge.jgenfile.Operation
abort, addOperationHints, getLastRunException, getOperationHint, getOperationHints, hasRun, setOperationHint, setOperationHints
 

Method Detail

getDeletedFilesCount

public int getDeletedFilesCount()
                         throws OperationNotFinishedException,
                                JGenFileException
Returns the number of files that were deleted by this operation. If the number of deleted files is unknown, -1 should be returned.

This number is only useful if the item that was deleted was a directory and contained other items.

Throws:
OperationNotFinishedException - if this method was called and the run() method has not finished or has not been called.
JGenFileException - if another error occurs.

run

public void run()
         throws JGenFileException,
                PartialDeleteException
Runs this operation.

Specified by:
run in interface Operation
Throws:
PartialDeleteException - if this item is a directory, and only some of the items inside the directory could be deleted.
JGenFileException - if another error occurs.
See Also:
Operation.abort()