Class AbstractIOTask

java.lang.Object
org.openstreetmap.josm.gui.io.AbstractIOTask
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
SaveLayerTask, UploadLayerTask, UploadNoteLayerTask

public abstract class AbstractIOTask extends Object implements 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
    indicates whether the task has been canceled
    private boolean
    indicates whether the task has been failed
    private Exception
    the last exception caught
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a new AbstractIOTask.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Cancel the task
    Replies the last exception caught
    boolean
    Replies true if the task has been canceled
    boolean
    Replies true if the task has been failed
    boolean
    Replies true if this task was successful, i.e.
    protected void
    setCanceled(boolean canceled)
    Set whether this task has been canceled
    protected void
    setFailed(boolean failed)
    Sets whether the task has been failed
    protected void
    setLastException(Exception lastException)
    Sets the last exception caught

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Runnable

    run
  • Field Details

    • canceled

      private boolean canceled
      indicates whether the task has been canceled
    • failed

      private boolean failed
      indicates whether the task has been failed
    • lastException

      the last exception caught
  • Constructor Details

    • AbstractIOTask

      protected AbstractIOTask()
      Constructs a new AbstractIOTask.
  • Method Details

    • 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

      Replies the last exception caught
      Returns:
      the last exception caught; null, if no exception was caught
    • setLastException

      protected void setLastException(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