|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sonatype.aether.util.listener.DefaultTransferEvent
public class DefaultTransferEvent
A simple transfer event.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.sonatype.aether.transfer.TransferEvent |
|---|
TransferEvent.EventType, TransferEvent.RequestType |
| Constructor Summary | |
|---|---|
DefaultTransferEvent()
|
|
| Method Summary | |
|---|---|
ByteBuffer |
getDataBuffer()
Gets the byte buffer holding the transferred bytes since the last event. |
int |
getDataLength()
Gets the number of bytes that have been transferred since the last event. |
Exception |
getException()
Gets the error that occurred during the transfer. |
TransferEvent.RequestType |
getRequestType()
Gets the type of the request/transfer. |
TransferResource |
getResource()
Gets the resource that is being transferred. |
long |
getTransferredBytes()
Gets the total number of bytes that have been transferred since the download/upload was started. |
TransferEvent.EventType |
getType()
Gets the type of the event. |
DefaultTransferEvent |
setDataBuffer(byte[] buffer,
int offset,
int length)
Wraps the given byte[]-array into a ByteBuffer as the content for this event. |
DefaultTransferEvent |
setDataBuffer(ByteBuffer dataBuffer)
Sets the byte buffer holding the transferred bytes since the last event. |
DefaultTransferEvent |
setException(Exception exception)
Sets the error that occurred during the transfer. |
DefaultTransferEvent |
setRequestType(TransferEvent.RequestType requestType)
Sets the type of the request/transfer. |
DefaultTransferEvent |
setResource(TransferResource resource)
Sets the resource being transferred. |
DefaultTransferEvent |
setTransferredBytes(long transferredBytes)
Sets the total number of bytes that have been transferred so far during the download/upload. |
DefaultTransferEvent |
setType(TransferEvent.EventType type)
Sets the type of the event. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultTransferEvent()
| Method Detail |
|---|
public TransferEvent.EventType getType()
TransferEvent
getType in interface TransferEventnull.public DefaultTransferEvent setType(TransferEvent.EventType type)
type - The type of the event, must not be null.
null.public TransferEvent.RequestType getRequestType()
TransferEvent
getRequestType in interface TransferEventnull.public DefaultTransferEvent setRequestType(TransferEvent.RequestType requestType)
requestType - The request/transfer type, must not be null.
null.public TransferResource getResource()
TransferEvent
getResource in interface TransferEventnull.public DefaultTransferEvent setResource(TransferResource resource)
resource - The resource being transferred, must not be null.
null.public long getTransferredBytes()
TransferEvent
getTransferredBytes in interface TransferEventTransferEvent.getDataLength()public DefaultTransferEvent setTransferredBytes(long transferredBytes)
transferredBytes - The total number of bytes that have been transferred so far during the download/upload,
must not be negative.
null.public int getDataLength()
TransferEvent
getDataLength in interface TransferEventTransferEvent.getTransferredBytes()public ByteBuffer getDataBuffer()
TransferEvent
getDataBuffer in interface TransferEventnull if not applicable to the event, i.e. if the event type is not
TransferEvent.EventType.PROGRESSED.
public DefaultTransferEvent setDataBuffer(byte[] buffer,
int offset,
int length)
byte[]-array into a ByteBuffer as the content for this event.
buffer - The array to use, must not be null.offset - the starting point of valid bytes in the array.length - the number of valid bytes.
null.public DefaultTransferEvent setDataBuffer(ByteBuffer dataBuffer)
dataBuffer - The byte buffer holding the transferred bytes since the last event, may be null.
null.public Exception getException()
TransferEvent
getException in interface TransferEventnull if none.public DefaultTransferEvent setException(Exception exception)
exception - The error that occurred during the transfer, may be null if none.
null.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||