org.xnap.plugin.gift.net
Class GiFTUpload

java.lang.Object
  extended by org.xnap.transfer.AbstractTransfer
      extended by org.xnap.transfer.AbstractUpload
          extended by org.xnap.plugin.gift.net.GiFTUpload
All Implemented Interfaces:
java.util.EventListener, UploadEventListener, Transfer, Upload

public class GiFTUpload
extends AbstractUpload
implements UploadEventListener

Author:
Tammo

Field Summary
 
Fields inherited from class org.xnap.transfer.AbstractTransfer
logger, MIN_RECALC_INTERVAL, RECALC_INTERVAL, SOCKET_TIMEOUT
 
Fields inherited from interface org.xnap.transfer.Transfer
TRANSFER_TIMEOUT
 
Constructor Summary
GiFTUpload(GiFTUser user, java.lang.String url, long filesize, long transmit)
           
 
Method Summary
 javax.swing.Action[] getActions()
          Returns the actions that can performed by the transfer.
 long getBytesTransferred()
          Returns how many bytes have been transferred since the transfer was started.
 java.io.File getFile()
          Returns the file the transfer is using.
 java.lang.String getFilename()
          Returns the filename that should be presented to the user.
 long getFilesize()
          Returns the final filesize.
 java.lang.String getGID()
           
 Peer getPeer()
          Returns the peer.
 Plugin getPlugin()
          Returns the plugin.
 Segment[] getSegments()
          Returns the segments for segmented downloads.
 java.lang.String getStatus()
          Returns the current status that should be presented to the user.
 long getTotalBytesTransferred()
          Returns how many bytes have been transferred.
 boolean isDone()
          Returns true if the transfer is finished.
 boolean isFailed()
           
 boolean isMarked()
           
 boolean isRunning()
          Returns true if the transfer is running.
 void setGID(java.lang.String gid)
           
 void setMarked(boolean marked)
           
 void setStatus(java.lang.String status)
           
 void updated(java.lang.String status, long start, long transmit, long total)
           
 void uploadCanceled()
           
 void uploadUpdated(UploadUpdatedEvent evt)
           
 
Methods inherited from class org.xnap.transfer.AbstractTransfer
addStateListener, cleared, getAverageRate, getCurrentRate, getDescription, getElapsedTime, getIcon, getQueuePosition, getRemainingTime, removeStateListener, stateChanged, toString, transferStarted, transferStopped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xnap.transfer.Transfer
addStateListener, cleared, getAverageRate, getCurrentRate, getDescription, getIcon, getQueuePosition, getRemainingTime, removeStateListener
 

Constructor Detail

GiFTUpload

public GiFTUpload(GiFTUser user,
                  java.lang.String url,
                  long filesize,
                  long transmit)
Method Detail

setStatus

public void setStatus(java.lang.String status)

getActions

public javax.swing.Action[] getActions()
Description copied from interface: Transfer
Returns the actions that can performed by the transfer.

Specified by:
getActions in interface Transfer
See Also:
xnap.transfer.Transfer#getActions()

getBytesTransferred

public long getBytesTransferred()
Description copied from class: AbstractTransfer
Returns how many bytes have been transferred since the transfer was started.

Specified by:
getBytesTransferred in class AbstractTransfer
Returns:
number of transferred bytes
See Also:
xnap.transfer.Transfer#getTotalBytesTransferred()

getFile

public java.io.File getFile()
Description copied from interface: Transfer
Returns the file the transfer is using.

Specified by:
getFile in interface Transfer
Returns:
null, if file is unknown; the file, otherwise
See Also:
xnap.transfer.Transfer#getFile()

getPeer

public Peer getPeer()
Description copied from interface: Transfer
Returns the peer.

Specified by:
getPeer in interface Transfer
See Also:
xnap.transfer.Transfer#getPeer()

getPlugin

public Plugin getPlugin()
Description copied from interface: Transfer
Returns the plugin.

Specified by:
getPlugin in interface Transfer

getSegments

public Segment[] getSegments()
Description copied from interface: Transfer
Returns the segments for segmented downloads.

Specified by:
getSegments in interface Transfer
Overrides:
getSegments in class AbstractTransfer
Returns:
null, if segments are not supported (which means that there is only one segment that represents the whole file)

getTotalBytesTransferred

public long getTotalBytesTransferred()
Description copied from interface: Transfer
Returns how many bytes have been transferred.

Specified by:
getTotalBytesTransferred in interface Transfer
Returns:
number of transferred bytes
See Also:
xnap.transfer.Transfer#getTotalBytesTransferred()

getStatus

public java.lang.String getStatus()
Description copied from interface: Transfer
Returns the current status that should be presented to the user.

Specified by:
getStatus in interface Transfer
See Also:
xnap.transfer.Transfer#getStatus()

isDone

public boolean isDone()
Description copied from interface: Transfer
Returns true if the transfer is finished.

Specified by:
isDone in interface Transfer
Returns:
true, if thread has ended and the transfer can be cleared; false if, not yet started or still running
See Also:
xnap.transfer.Transfer#isDone()

isFailed

public boolean isFailed()
See Also:
xnap.transfer.Transfer#isFailed()

isMarked

public boolean isMarked()

isRunning

public boolean isRunning()
Description copied from interface: Transfer
Returns true if the transfer is running.

Specified by:
isRunning in interface Transfer
Returns:
true, if data is transferred or a connect is in progress; false, if queued, not yet started or done
See Also:
xnap.transfer.Transfer#isRunning()

updated

public void updated(java.lang.String status,
                    long start,
                    long transmit,
                    long total)
Parameters:
l -

getFilename

public java.lang.String getFilename()
Description copied from interface: Transfer
Returns the filename that should be presented to the user.

Specified by:
getFilename in interface Transfer
Overrides:
getFilename in class AbstractTransfer
See Also:
xnap.transfer.Transfer#getFilename()

getFilesize

public long getFilesize()
Description copied from interface: Transfer
Returns the final filesize.

Specified by:
getFilesize in interface Transfer
Overrides:
getFilesize in class AbstractTransfer
See Also:
xnap.transfer.Transfer#getFilesize()

setMarked

public void setMarked(boolean marked)

setGID

public void setGID(java.lang.String gid)

getGID

public java.lang.String getGID()

uploadUpdated

public void uploadUpdated(UploadUpdatedEvent evt)
Specified by:
uploadUpdated in interface UploadEventListener
See Also:
xnap.plugin.gift.net.event.listener.UploadEventListener#uploadUpdated(xnap.plugin.gift.net.event.UploadUpdatedEvent)

uploadCanceled

public void uploadCanceled()
Specified by:
uploadCanceled in interface UploadEventListener
See Also:
xnap.plugin.gift.net.event.listener.UploadEventListener#uploadCanceled()


Copyright © 2001-2005 XNap Team. All Rights Reserved.