|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An operation does something with a filesystem, for instance it might query the size of a file or rename a file.
When finished with any operation, it should be closed using the close() method.
Method Summary | |
void |
abort()
Aborts the operation if it is currently running. |
void |
addOperationHints(au.com.prunge.jgenfile.OperationHints hints)
Adds operation hints to this operation. |
au.com.prunge.jgenfile.JGenFileException |
getLastRunException()
Returns the exception that occurred on the last run of this operation. |
OperationHints.Value |
getOperationHint(OperationHints.Key key)
Returns the value of a single hint. |
au.com.prunge.jgenfile.OperationHints |
getOperationHints()
Returns the operation hints used for this operation. |
boolean |
hasRun()
|
void |
run()
Begins execution of this operation. |
void |
setOperationHint(OperationHints.Key key,
OperationHints.Value value)
Sets the value of a single hint for this operation. |
void |
setOperationHints(au.com.prunge.jgenfile.OperationHints hints)
Sets the hints for this operation. |
Method Detail |
public void run() throws JGenFileException, OperationNotSupportedException, OperationAbortedException
JGenFileException
- if an error occurs executing
the operation.
OperationNotSupportedException
- if this operation
is not supported by the file system.
OperationAbortedException
- if the operation
was aborted before it completed running.abort()
public boolean hasRun()
public au.com.prunge.jgenfile.JGenFileException getLastRunException()
public void addOperationHints(au.com.prunge.jgenfile.OperationHints hints) throws NullPointerException
hints
- the hints to add.
NullPointerException
- if hints
is null.public void setOperationHints(au.com.prunge.jgenfile.OperationHints hints) throws NullPointerException
hints
- the hints to set.
NullPointerException
- if hints
is null.public au.com.prunge.jgenfile.OperationHints getOperationHints()
public OperationHints.Value getOperationHint(OperationHints.Key key) throws NullPointerException
key
- the operation hints key to get the value of.
NullPointerException
- if key
is null.public void setOperationHint(OperationHints.Key key, OperationHints.Value value) throws NullPointerException
key
- the key for the operation hint.value
- the value to give the operation hint.
NullPointerException
- if key
or value
is null.public void abort()
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.
run()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |