Package org.openstreetmap.josm.gui.io
Class AbstractIOTask
java.lang.Object
org.openstreetmap.josm.gui.io.AbstractIOTask
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
SaveLayerTask,UploadLayerTask,UploadNoteLayerTask
This is an abstract task for uploading or saving a data layer.
- Since:
- 2025
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanindicates whether the task has been canceledprivate booleanindicates whether the task has been failedprivate Exceptionthe last exception caught -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcancel()Cancel the taskReplies the last exception caughtbooleanReplies true if the task has been canceledbooleanisFailed()Replies true if the task has been failedbooleanReplies true if this task was successful, i.e.protected voidsetCanceled(boolean canceled) Set whether this task has been canceledprotected voidsetFailed(boolean failed) Sets whether the task has been failedprotected voidsetLastException(Exception lastException) Sets the last exception caught
-
Field Details
-
canceled
indicates whether the task has been canceled -
failed
indicates whether the task has been failed -
lastException
the last exception caught
-
-
Constructor Details
-
AbstractIOTask
protected AbstractIOTask()Constructs a newAbstractIOTask.
-
-
Method Details
-
isCanceled
Replies true if the task has been canceled- Returns:
- true if the task has been canceled
-
setCanceled
Set whether this task has been canceled- Parameters:
canceled- true, if the task has been canceled; false otherwise
-
isFailed
Replies true if the task has been failed- Returns:
- true if the task has been failed
-
setFailed
Sets whether the task has been failed- Parameters:
failed- whether the task has been failed
-
getLastException
Replies the last exception caught- Returns:
- the last exception caught; null, if no exception was caught
-
setLastException
Sets the last exception caught- Parameters:
lastException- the last exception
-
isSuccessful
Replies true if this task was successful, i.e. if it wasn't canceled and didn't fail- Returns:
- true if this task was successful
-
cancel
Cancel the task
-