com.evolution.player.core.network
Class URLDownload

java.lang.Object
  extended by com.evolution.player.core.network.FileTransfer
      extended by com.evolution.player.core.network.Download
          extended by com.evolution.player.core.network.URLDownload

public abstract class URLDownload
extends Download

An URL download can download a file referenced by an URL.

Clients can implement.

Since:
0.6

Constructor Summary
URLDownload(MediaInfo media, java.net.URL url, java.io.File targetFolder)
          Create a new url download downloading the given media.
 
Method Summary
 LocalMediaInfo download(IProgressMonitor monitor)
          Download FileTransfer.getMediaInfo() and return the downloaded media if the download succeeded, throws IOException if the download failed, returns null if the monitor was canceled.
 
Methods inherited from class com.evolution.player.core.network.Download
getLength, getPercentage, getSpeed, getTransfered
 
Methods inherited from class com.evolution.player.core.network.FileTransfer
getMediaInfo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLDownload

public URLDownload(MediaInfo media,
                   java.net.URL url,
                   java.io.File targetFolder)
Create a new url download downloading the given media.

Parameters:
media - the media to download
url - the url from where to retrieve the media
targetFolder - the folder to where to download to
Method Detail

download

public LocalMediaInfo download(IProgressMonitor monitor)
                        throws java.io.IOException
Description copied from class: Download
Download FileTransfer.getMediaInfo() and return the downloaded media if the download succeeded, throws IOException if the download failed, returns null if the monitor was canceled.

Specified by:
download in class Download
Parameters:
monitor - a monitor to report progress to and the check for cancelation
Returns:
the downloaded media
Throws:
java.io.IOException - if something went wrong during the download