Class TransferEvent

All Implemented Interfaces:
Serializable

public class TransferEvent extends WagonEvent
TransferEvent is used to notify TransferListeners about progress in transfer of resources form/to the repository
Author:
Michal Maczka
See Also:
  • Field Details

    • TRANSFER_INITIATED

      public static final int TRANSFER_INITIATED
      A transfer was attempted, but has not yet commenced.
      See Also:
    • TRANSFER_STARTED

      public static final int TRANSFER_STARTED
      A transfer was started.
      See Also:
    • TRANSFER_COMPLETED

      public static final int TRANSFER_COMPLETED
      A transfer is completed.
      See Also:
    • TRANSFER_PROGRESS

      public static final int TRANSFER_PROGRESS
      A transfer is in progress.
      See Also:
    • TRANSFER_ERROR

      public static final int TRANSFER_ERROR
      An error occurred during transfer
      See Also:
    • REQUEST_GET

      public static final int REQUEST_GET
      Indicates GET transfer (from the repository)
      See Also:
    • REQUEST_PUT

      public static final int REQUEST_PUT
      Indicates PUT transfer (to the repository)
      See Also:
  • Constructor Details

    • TransferEvent

      public TransferEvent(Wagon wagon, Resource resource, int eventType, int requestType)
    • TransferEvent

      public TransferEvent(Wagon wagon, Resource resource, Exception exception, int requestType)
  • Method Details

    • getResource

      public Resource getResource()
      Returns:
      Returns the resource.
    • getException

      public Exception getException()
      Returns:
      Returns the exception.
    • getRequestType

      public int getRequestType()
      Returns the request type.
      Returns:
      Returns the request type. The Request type is one of TransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT
    • setRequestType

      public void setRequestType(int requestType)
      Sets the request type
      Parameters:
      requestType - The requestType to set. The Request type value should be either TransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT.
      Throws:
      IllegalArgumentException - when
    • getEventType

      public int getEventType()
      Returns:
      Returns the eventType.
    • setEventType

      public void setEventType(int eventType)
      Parameters:
      eventType - The eventType to set.
    • setResource

      public void setResource(Resource resource)
      Parameters:
      resource - The resource to set.
    • getLocalFile

      public File getLocalFile()
      Returns:
      Returns the local file.
    • setLocalFile

      public void setLocalFile(File localFile)
      Parameters:
      localFile - The local file to set.
    • toString

      public String toString()
      Overrides:
      toString in class EventObject
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object