| java.lang.Object org.apache.ivy.core.event.IvyEvent org.apache.ivy.plugins.repository.TransferEvent
TransferEvent | public class TransferEvent extends IvyEvent (Code) | | 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.
|
REQUEST_GET | final public static int REQUEST_GET(Code) | | Indicates GET transfer (from the repository)
|
REQUEST_PUT | final public static int REQUEST_PUT(Code) | | Indicates PUT transfer (to the repository)
|
TRANSFER_COMPLETED | final public static int TRANSFER_COMPLETED(Code) | | A transfer is completed.
|
TRANSFER_COMPLETED_NAME | final public static String TRANSFER_COMPLETED_NAME(Code) | | |
TRANSFER_ERROR | final public static int TRANSFER_ERROR(Code) | | An error occured during transfer
|
TRANSFER_ERROR_NAME | final public static String TRANSFER_ERROR_NAME(Code) | | |
TRANSFER_INITIATED | final public static int TRANSFER_INITIATED(Code) | | A transfer was attempted, but has not yet commenced.
|
TRANSFER_INITIATED_NAME | final public static String TRANSFER_INITIATED_NAME(Code) | | |
TRANSFER_PROGRESS | final public static int TRANSFER_PROGRESS(Code) | | A transfer is in progress.
|
TRANSFER_PROGRESS_NAME | final public static String TRANSFER_PROGRESS_NAME(Code) | | |
TRANSFER_STARTED | final public static int TRANSFER_STARTED(Code) | | A transfer was started.
|
TRANSFER_STARTED_NAME | final public static String TRANSFER_STARTED_NAME(Code) | | |
getElapsedTime | public long getElapsedTime(int fromEventType, int toEventType)(Code) | | Returns the elapsed time (in ms) between when the event entered one type until it entered
another event time.
This is especially useful to get the elapsed transfer time:
getElapsedTime(TransferEvent.TRANSFER_STARTED, TransferEvent.TRANSFER_COMPLETED);
Special cases:
- returns -1 if the event never entered the fromEventType or the toEventType.
- returns 0 if the event entered toEventType before fromEventType
Parameters: fromEventType - the event type constant from which time should be measured Parameters: toEventType - the event type constant to which time should be measured the elapsed time (in ms) between when the event entered fromEventType until itentered toEventType. throws: IllegalArgumentException - if either type is not a known constant event type. |
getEventType | public int getEventType()(Code) | | Returns the eventType. |
getLength | public long getLength()(Code) | | |
getLocalFile | public File getLocalFile()(Code) | | Returns the local file. |
getRequestType | public int getRequestType()(Code) | | Returns the request type.
Returns the request type. The Request type is one ofTransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT
|
getTotalLength | public long getTotalLength()(Code) | | |
isTotalLengthSet | public boolean isTotalLengthSet()(Code) | | |
setEventType | protected void setEventType(int eventType)(Code) | | Parameters: eventType - The eventType to set. |
setLength | protected void setLength(long length)(Code) | | |
setLocalFile | protected void setLocalFile(File localFile)(Code) | | Parameters: localFile - The local file to set. |
setRequestType | protected void setRequestType(int requestType)(Code) | | Sets the request type
Parameters: requestType - The requestType to set. The Request type value should be eitherTransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT. throws: IllegalArgumentException - when |
setResource | protected void setResource(Resource resource)(Code) | | Parameters: resource - The resource to set. |
setTotalLength | protected void setTotalLength(long totalLength)(Code) | | |
setTotalLengthSet | public void setTotalLengthSet(boolean isTotalLengthSet)(Code) | | |
|
|