Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## fr.jayasoft.ivy.repository
Class TransferEvent

    java.lang.Object
      fr.jayasoft.ivy.event.IvyEvent
          fr.jayasoft.ivy.repository.TransferEvent

public class TransferEvent
extends IvyEvent

TransferEvent is used to notify TransferListeners about progress in transfer of resources form/to the respository This class is LARGELY inspired by org.apache.maven.wagon.events.TransferEvent released under the following copyright license:

      Copyright 2001-2005 The Apache Software Foundation.

      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

           http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

Orginal class written by Michal Maczka.

Field Summary
`static int` | `REQUEST_GET` Indicates GET transfer (from the repository)
`static int` | `REQUEST_PUT` Indicates PUT transfer (to the repository)
`static int` | `TRANSFER_COMPLETED` A transfer is completed.
`static int` | `TRANSFER_ERROR` An error occured during transfer
`static int` | `TRANSFER_INITIATED` A transfer was attempted, but has not yet commenced.
`static int` | `TRANSFER_PROGRESS` A transfer is in progress.
`static int` | `TRANSFER_STARTED` A transfer was started.

Constructor Summary
`TransferEvent(Repository repository, Resource resource, byte[] buffer, long length, int requestType)`
`TransferEvent(Repository repository, Resource resource, java.lang.Exception exception, int requestType)`
`TransferEvent(Repository repository, Resource resource, int eventType, int requestType)`

Method Summary
`byte[]` | `getBuffer()`
`int` | `getEventType()`
`java.lang.Exception` | `getException()`
`long` | `getLength()`
`java.io.File` | `getLocalFile()`
`int` | `getRequestType()` Returns the request type.
`Resource` | `getResource()`
`long` | `getTotalLength()`
`boolean` | `isTotalLengthSet()`
`protected void` | `setBuffer(byte[] buffer)`
`protected void` | `setEventType(int eventType)`
`void` | `setException(java.lang.Exception exception)`
`protected void` | `setLength(long length)`
`protected void` | `setLocalFile(java.io.File localFile)`
`protected void` | `setRequestType(int requestType)` Sets the request type
`protected void` | `setResource(Resource resource)`
`protected void` | `setTotalLength(long totalLength)`
`void` | `setTotalLengthSet(boolean isTotalLengthSet)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TRANSFER_INITIATED

    public static final int TRANSFER_INITIATED

  A transfer was attempted, but has not yet commenced.

  See Also:
    Constant Field Values

### TRANSFER_STARTED

    public static final int TRANSFER_STARTED

  A transfer was started.

  See Also:
    Constant Field Values

### TRANSFER_COMPLETED

    public static final int TRANSFER_COMPLETED

  A transfer is completed.

  See Also:
    Constant Field Values

### TRANSFER_PROGRESS

    public static final int TRANSFER_PROGRESS

  A transfer is in progress.

  See Also:
    Constant Field Values

### TRANSFER_ERROR

    public static final int TRANSFER_ERROR

  An error occured during transfer

  See Also:
    Constant Field Values

### REQUEST_GET

    public static final int REQUEST_GET

  Indicates GET transfer (from the repository)

  See Also:
    Constant Field Values

### REQUEST_PUT

    public static final int REQUEST_PUT

  Indicates PUT transfer (to the repository)

  See Also:
    Constant Field Values

Constructor Detail

### TransferEvent

    public TransferEvent(Repository repository,
                         Resource resource,
                         int eventType,
                         int requestType)

### TransferEvent

    public TransferEvent(Repository repository,
                         Resource resource,
                         java.lang.Exception exception,
                         int requestType)

### TransferEvent

    public TransferEvent(Repository repository,
                         Resource resource,
                         byte[] buffer,
                         long length,
                         int requestType)

Method Detail

### getResource

    public Resource getResource()

  Returns:
    Returns the resource.

### getException

    public java.lang.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

    protected 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:
    `java.lang.IllegalArgumentException` - when

### getEventType

    public int getEventType()

  Returns:
    Returns the eventType.

### setEventType

    protected void setEventType(int eventType)

  Parameters:
    `eventType` - The eventType to set.

### setResource

    protected void setResource(Resource resource)

### getLocalFile

    public java.io.File getLocalFile()

  Returns:
    Returns the local file.

### setLocalFile

    protected void setLocalFile(java.io.File localFile)

  Parameters:
    `localFile` - The local file to set.

### getBuffer

    public byte[] getBuffer()

### setBuffer

    protected void setBuffer(byte[] buffer)

### getLength

    public long getLength()

### setLength

    protected void setLength(long length)

### getTotalLength

    public long getTotalLength()

### setTotalLength

    protected void setTotalLength(long totalLength)

### setException

    public void setException(java.lang.Exception exception)

### isTotalLengthSet

    public boolean isTotalLengthSet()

### setTotalLengthSet

    public void setTotalLengthSet(boolean isTotalLengthSet)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD