org.apache.maven.wagon.events

Class TransferEvent

public class TransferEvent extends WagonEvent

TransferEvent is used to notify TransferListeners about progress in transfer of resources form/to the respository

Version: $Id: TransferEvent.java 162476 2005-04-19 02:49:45Z brett $

Author: Michal Maczka

Field Summary
inteventType
Exceptionexception
FilelocalFile
intrequestType
Resourceresource
static intREQUEST_GET
Indicates GET transfer (from the repository)
static intREQUEST_PUT
Indicates PUT transfer (to the repository)
static intTRANSFER_COMPLETED
A transfer is completed.
static intTRANSFER_ERROR
An error occured during transfer
static intTRANSFER_INITIATED
A transfer was attempted, but has not yet commenced.
static intTRANSFER_PROGRESS
A transfer is in progress.
static intTRANSFER_STARTED
A transfer was started.
Constructor Summary
TransferEvent(Wagon wagon, Resource resource, int eventType, int requestType)
TransferEvent(Wagon wagon, Resource resource, Exception exception, int requestType)
Method Summary
intgetEventType()
ExceptiongetException()
FilegetLocalFile()
intgetRequestType()
Returns the request type.
ResourcegetResource()
voidsetEventType(int eventType)
voidsetLocalFile(File localFile)
voidsetRequestType(int requestType)
Sets the request type
voidsetResource(Resource resource)

Field Detail

eventType

private int eventType

exception

private Exception exception

localFile

private File localFile

requestType

private int requestType

resource

private Resource resource

REQUEST_GET

public static final int REQUEST_GET
Indicates GET transfer (from the repository)

REQUEST_PUT

public static final int REQUEST_PUT
Indicates PUT transfer (to the repository)

TRANSFER_COMPLETED

public static final int TRANSFER_COMPLETED
A transfer is completed.

TRANSFER_ERROR

public static final int TRANSFER_ERROR
An error occured during transfer

TRANSFER_INITIATED

public static final int TRANSFER_INITIATED
A transfer was attempted, but has not yet commenced.

TRANSFER_PROGRESS

public static final int TRANSFER_PROGRESS
A transfer is in progress.

TRANSFER_STARTED

public static final int TRANSFER_STARTED
A transfer was started.

Constructor Detail

TransferEvent

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

TransferEvent

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

Method Detail

getEventType

public int getEventType()

Returns: Returns the eventType.

getException

public Exception getException()

Returns: Returns the exception.

getLocalFile

public File getLocalFile()

Returns: Returns the local file.

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

getResource

public Resource getResource()

Returns: Returns the resource.

setEventType

public void setEventType(int eventType)

Parameters: eventType The eventType to set.

setLocalFile

public void setLocalFile(File localFile)

Parameters: localFile The local file to set.

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

setResource

public void setResource(Resource resource)

Parameters: resource The resource to set.