LimeWire Consolidated API

com.limegroup.gnutella
Interface DownloadServices

All Known Implementing Classes:
DownloadServicesImpl

public interface DownloadServices


Method Summary
 Downloader download(File incompleteFile)
          Starts a resume download for the given incomplete file.
 Downloader download(MagnetOptions magnet, boolean overwrite)
          Creates a downloader for a magnet.
 Downloader download(MagnetOptions magnet, boolean overwrite, File saveDir, String fileName)
          Creates a downloader for a magnet using the given additional options.
 Downloader download(RemoteFileDesc[] files, boolean overwrite, GUID queryGUID)
           
 Downloader download(RemoteFileDesc[] files, GUID queryGUID, boolean overwrite, File saveDir, String fileName)
          Stub for calling download(RemoteFileDesc[], DataUtils.EMPTY_LIST, boolean)
 Downloader download(RemoteFileDesc[] files, List<? extends RemoteFileDesc> alts, GUID queryGUID, boolean overwrite)
           
 Downloader download(RemoteFileDesc[] files, List<? extends RemoteFileDesc> alts, GUID queryGUID, boolean overwrite, File saveDir, String fileName)
          Tries to "smart download" any [sic] of the given files.
 Downloader downloadFromStore(RemoteFileDesc rfd, boolean overwrite, File saveDir, String fileName)
          Creates a downloader for songs purchased from the LimeWire Store (LWS)
 Downloader downloadTorrent(BTMetaInfo info, boolean overwrite)
          Starts a torrent download for a given Inputstream to the .torrent file
 int getNumActiveDownloads()
          Returns the number of active downloads.
 int getNumDownloads()
          Returns the number of downloads in progress.
 boolean hasActiveDownloads()
          Returns whether there are any active internet (non-multicast) transfers going at speed greater than 0.
 

Method Detail

download

Downloader download(File incompleteFile)
                    throws CantResumeException,
                           SaveLocationException
Starts a resume download for the given incomplete file.

Throws:
CantResumeException - incompleteFile is not a valid incomplete file
SaveLocationException

download

Downloader download(MagnetOptions magnet,
                    boolean overwrite,
                    File saveDir,
                    String fileName)
                    throws SaveLocationException
Creates a downloader for a magnet using the given additional options.

Parameters:
magnet - provides the information of the file to download, must be valid
overwrite - whether an existing file a the final file location should be overwritten
saveDir - can be null, then the save directory from the settings is used
fileName - the final filename of the download, can be null
Returns:
Throws:
SaveLocationException
IllegalArgumentException - if the magnet is not downloadable.

download

Downloader download(MagnetOptions magnet,
                    boolean overwrite)
                    throws SaveLocationException
Creates a downloader for a magnet.

Parameters:
magnetprovides - the information of the file to download, must be valid
overwrite - whether an existing file a the final file location should be overwritten
Returns:
Throws:
SaveLocationException
IllegalArgumentException - if the magnet is not valid.

downloadFromStore

Downloader downloadFromStore(RemoteFileDesc rfd,
                             boolean overwrite,
                             File saveDir,
                             String fileName)
                             throws SaveLocationException
Creates a downloader for songs purchased from the LimeWire Store (LWS)

Parameters:
store - - provides information of the file to download including a URN
overwrite - - whether an existing file with the same name should be overwritten
saveDir - - location to store the completed download to, this may be different than downloads from gnutella
fileName - - name of the file once completed
Returns:
Throws:
SaveLocationException

download

Downloader download(RemoteFileDesc[] files,
                    boolean overwrite,
                    GUID queryGUID)
                    throws SaveLocationException
Throws:
SaveLocationException

download

Downloader download(RemoteFileDesc[] files,
                    GUID queryGUID,
                    boolean overwrite,
                    File saveDir,
                    String fileName)
                    throws SaveLocationException
Stub for calling download(RemoteFileDesc[], DataUtils.EMPTY_LIST, boolean)

Throws:
SaveLocationException

download

Downloader download(RemoteFileDesc[] files,
                    List<? extends RemoteFileDesc> alts,
                    GUID queryGUID,
                    boolean overwrite)
                    throws SaveLocationException
Throws:
SaveLocationException

download

Downloader download(RemoteFileDesc[] files,
                    List<? extends RemoteFileDesc> alts,
                    GUID queryGUID,
                    boolean overwrite,
                    File saveDir,
                    String fileName)
                    throws SaveLocationException
Tries to "smart download" any [sic] of the given files.

If any of the files already being downloaded (or queued for downloaded) has the same temporary name as any of the files in 'files', throws SaveLocationException. Note, however, that this doesn't guarantee that a successfully downloaded file can be moved to the library.

If overwrite==false, then if any of the files already exists in the download directory, SaveLocationException is thrown and no files are modified. If overwrite==true, the files may be overwritten.

Otherwise returns a Downloader that allows you to stop and resume this download. The ActivityCallback will also be notified of this download, so the return value can usually be ignored. The download begins immediately, unless it is queued. It stops after any of the files succeeds.

Parameters:
files - a group of "similar" files to smart download
alts - a List of secondary RFDs to use for other sources
queryGUID - guid of the query that returned the results (i.e. files)
overwrite - true iff the download should proceedewithout checking if it's on disk
saveDir - can be null, then the save directory from the settings is used
fileName - can be null, then one of the filenames of the files array is used array is used
Returns:
the download object you can use to start and resume the download
Throws:
SaveLocationException - if there is an error when setting the final file location of the download
See Also:
DownloadManager#getFiles(RemoteFileDesc[], boolean)

downloadTorrent

Downloader downloadTorrent(BTMetaInfo info,
                           boolean overwrite)
                           throws SaveLocationException
Starts a torrent download for a given Inputstream to the .torrent file

Parameters:
is - the InputStream belonging to the .torrent file
Throws:
IOException - in case there was a problem reading the file
SaveLocationException

hasActiveDownloads

boolean hasActiveDownloads()
Returns whether there are any active internet (non-multicast) transfers going at speed greater than 0.


getNumActiveDownloads

int getNumActiveDownloads()
Returns the number of active downloads.


getNumDownloads

int getNumDownloads()
Returns the number of downloads in progress.


LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.