com.evolution.player.core.network
Class FileTransfer

java.lang.Object
  extended by com.evolution.player.core.network.FileTransfer
Direct Known Subclasses:
Download

public abstract class FileTransfer
extends java.lang.Object

A file transfer describes a transfer of a file through a network connection.

Clients should implement Download or a subclass of Download.

Since:
0.1

Constructor Summary
FileTransfer(MediaInfo media)
          Create a new file transfer transferring the given media
 
Method Summary
abstract  int getLength()
          The length of the file to transfer in bytes.
 MediaInfo getMediaInfo()
          The transfered media.
abstract  int getPercentage()
          The percentage transfered so far.
abstract  double getSpeed()
          The current speed of the download in KB per second if know.
abstract  int getTransfered()
          The amount of bytes transfered so far.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTransfer

public FileTransfer(MediaInfo media)
Create a new file transfer transferring the given media

Parameters:
media - the media to transfer
Method Detail

getMediaInfo

public MediaInfo getMediaInfo()
The transfered media.

Returns:
the transfered media

getLength

public abstract int getLength()
The length of the file to transfer in bytes.

Returns:
the length in bytes

getTransfered

public abstract int getTransfered()
The amount of bytes transfered so far.

Returns:
the amount of transfered bytes

getPercentage

public abstract int getPercentage()
The percentage transfered so far.

Returns:
the progress of the transfer in percentage

getSpeed

public abstract double getSpeed()
The current speed of the download in KB per second if know.

Returns:
speed of the transfer in KB per second or -1 if unknown