Package org.openstreetmap.josm.gui.io
Class AbstractIOTask
- java.lang.Object
-
- org.openstreetmap.josm.gui.io.AbstractIOTask
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
SaveLayerTask
,UploadLayerTask
,UploadNoteLayerTask
public abstract class AbstractIOTask extends java.lang.Object implements java.lang.Runnable
This is an abstract task for uploading or saving a data layer.- Since:
- 2025
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
canceled
indicates whether the task has been canceledprivate boolean
failed
indicates whether the task has been failedprivate java.lang.Exception
lastException
the last exception caught
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractIOTask()
Constructs a newAbstractIOTask
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
cancel()
Cancel the taskjava.lang.Exception
getLastException()
Replies the last exception caughtboolean
isCanceled()
Replies true if the task has been canceledboolean
isFailed()
Replies true if the task has been failedboolean
isSuccessful()
Replies true if this task was successful, i.e.protected void
setCanceled(boolean canceled)
Set whether this task has been canceledprotected void
setFailed(boolean failed)
Sets whether the task has been failedprotected void
setLastException(java.lang.Exception lastException)
Sets the last exception caught
-
-
-
Field Detail
-
canceled
private boolean canceled
indicates whether the task has been canceled
-
failed
private boolean failed
indicates whether the task has been failed
-
lastException
private java.lang.Exception lastException
the last exception caught
-
-
Constructor Detail
-
AbstractIOTask
protected AbstractIOTask()
Constructs a newAbstractIOTask
.
-
-
Method Detail
-
isCanceled
public boolean isCanceled()
Replies true if the task has been canceled- Returns:
- true if the task has been canceled
-
setCanceled
protected void setCanceled(boolean canceled)
Set whether this task has been canceled- Parameters:
canceled
- true, if the task has been canceled; false otherwise
-
isFailed
public boolean isFailed()
Replies true if the task has been failed- Returns:
- true if the task has been failed
-
setFailed
protected void setFailed(boolean failed)
Sets whether the task has been failed- Parameters:
failed
- whether the task has been failed
-
getLastException
public java.lang.Exception getLastException()
Replies the last exception caught- Returns:
- the last exception caught; null, if no exception was caught
-
setLastException
protected void setLastException(java.lang.Exception lastException)
Sets the last exception caught- Parameters:
lastException
- the last exception
-
isSuccessful
public boolean 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
public abstract void cancel()
Cancel the task
-
-