org.xnap.plugin.limewire
Class LimeWireDownload

java.lang.Object
  extended by org.xnap.transfer.AbstractTransfer
      extended by org.xnap.transfer.AbstractDownload
          extended by org.xnap.plugin.limewire.LimeWireDownload
All Implemented Interfaces:
Download, Transfer, TransferContainer

public class LimeWireDownload
extends AbstractDownload

Downloads a file.


Nested Class Summary
 class LimeWireDownload.BrowseAction
           
 class LimeWireDownload.ChatAction
           
 class LimeWireDownload.DeleteAction
           
 class LimeWireDownload.ResumeAction
           
 
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
LimeWireDownload(com.limegroup.gnutella.Downloader download)
           
 
Method Summary
 javax.swing.Action[] getActions()
          Returns the actions that can performed by the transfer.
 long getAverageRate()
          Returns the average transfer rate.
 long getBytesTransferred()
          Returns how many bytes have been transferred since the transfer was started.
 long getCurrentRate()
          Returns the current download rate.
 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.
 javax.swing.Icon getIcon()
          Returns null.
 Peer getPeer()
          Returns the peer.
 Plugin getPlugin()
          Returns the plugin.
 int getQueuePosition()
          Returns -1.
 int getRemainingTime()
          Returns the remaining time until the download is finished.
 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 isRunning()
          Returns true if the transfer is running.
 
Methods inherited from class org.xnap.transfer.AbstractDownload
add, addListListener, clearDone, getChildCount, getChildren, iterator, remove, removeListListener
 
Methods inherited from class org.xnap.transfer.AbstractTransfer
addStateListener, cleared, getDescription, getElapsedTime, getSegments, 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, getDescription, getSegments, removeStateListener
 

Constructor Detail

LimeWireDownload

public LimeWireDownload(com.limegroup.gnutella.Downloader download)
Method Detail

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:
AbstractTransfer.getCurrentRate()

getActions

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


getFile

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

Returns:
null, if file is unknown; the file, otherwise

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

getFilesize

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

Specified by:
getFilesize in interface Transfer
Overrides:
getFilesize in class AbstractTransfer

getPeer

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


getPlugin

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


getStatus

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


getTotalBytesTransferred

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

Returns:
number of transferred bytes

isDone

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

Returns:
true, if thread has ended and the transfer can be cleared; false if, not yet started or still running

isRunning

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

Returns:
true, if data is transferred or a connect is in progress; false, if queued, not yet started or done

getAverageRate

public long getAverageRate()
Description copied from class: AbstractTransfer
Returns the average transfer rate.

Specified by:
getAverageRate in interface Transfer
Overrides:
getAverageRate in class AbstractTransfer
Returns:
byte / s
See Also:
xnap.transfer.Transfer#getAverageRate()

getCurrentRate

public long getCurrentRate()
Description copied from class: AbstractTransfer
Returns the current download rate. Take at least a RECALC_INTERVAL into account to avoid jumping values all the time.

Specified by:
getCurrentRate in interface Transfer
Overrides:
getCurrentRate in class AbstractTransfer
Returns:
byte / s
See Also:
xnap.transfer.Transfer#getCurrentRate()

getIcon

public javax.swing.Icon getIcon()
Description copied from class: AbstractTransfer
Returns null.

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

getQueuePosition

public int getQueuePosition()
Description copied from class: AbstractTransfer
Returns -1.

Specified by:
getQueuePosition in interface Transfer
Overrides:
getQueuePosition in class AbstractTransfer
Returns:
-1, if the transfer is not queued, the position otherwise.
See Also:
xnap.transfer.Transfer#getQueuePosition()

getRemainingTime

public int getRemainingTime()
Description copied from interface: Transfer
Returns the remaining time until the download is finished.

Specified by:
getRemainingTime in interface Transfer
Overrides:
getRemainingTime in class AbstractTransfer
Returns:
the remaining time in s or -1 if unknown
See Also:
xnap.transfer.Transfer#getRemainingTime()


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