|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.downloader.ManagedDownloader
com.limegroup.gnutella.downloader.MagnetDownloader
A ManagedDownloader for MAGNET URIs. Unlike a ManagedDownloader, a MagnetDownloader need not have an initial RemoteFileDesc. Instead it can be started with various combinations of the following:
Implementation note: this uses ManagedDownloader to try the initial download location. Unfortunately ManagedDownloader requires RemoteFileDesc's. We can fake up most of the RFD fields, but size presents problems. ManagedDownloader depends on size for swarming purposes. It is possible to redesign the swarming algorithm to work around the lack of size, but this is complex, especially with regard to HTTP/1.1 swarming. For this reason, we simply make a HEAD request to get the content length before starting the download.
Field Summary |
Fields inherited from class com.limegroup.gnutella.downloader.ManagedDownloader |
UNKNOWN_FILENAME |
Fields inherited from interface com.limegroup.gnutella.Downloader |
ABORTED, COMPLETE, CONNECTING, CORRUPT_FILE, COULDNT_MOVE_TO_LIBRARY, DOWNLOADING, GAVE_UP, HASHING, QUEUED, REMOTE_QUEUED, SAVING, WAITING_FOR_CONNECTIONS, WAITING_FOR_RESULTS, WAITING_FOR_RETRY, WAITING_FOR_USER |
Constructor Summary | |
MagnetDownloader(DownloadManager manager,
FileManager filemanager,
IncompleteFileManager ifm,
ActivityCallback callback,
URN urn,
java.lang.String textQuery,
java.lang.String filename,
java.lang.String[] defaultURLs)
Creates a new MAGNET downloader. |
Method Summary | |
protected boolean |
allowAddition(RemoteFileDesc other)
Overrides ManagedDownloader to allow any files with the right hash/keywords, even if this doesn't currently have any download locations. |
java.lang.String |
getFileName()
Overrides ManagedDownloader to display a reasonable file name even when no locations have been found. |
protected QueryRequest |
newRequery(int numRequeries)
Overrides ManagedDownloader to use the query words and hash (if any) specified by the MAGNET URI. |
protected void |
tryAllDownloads(boolean deserialized)
Overrides ManagedDownloader to ensure that the default location is tried. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MagnetDownloader(DownloadManager manager, FileManager filemanager, IncompleteFileManager ifm, ActivityCallback callback, URN urn, java.lang.String textQuery, java.lang.String filename, java.lang.String[] defaultURLs)
manager
- controls download queuing; passed to superclassfilemanager
- shares saved files; passed to superclassifm
- maintains blocks stored on disk; passed to superclasscallback
- notifies GUI of updates; passed to superclassurn
- the hash of the file (exact topic), or null if unknowntextQuery
- requery keywords (keyword topic), or null if unknownfilename
- the final file name, or null if unknowndefaultURLs
- the initial locations to try (exact source), or null
if unknownMethod Detail |
protected void tryAllDownloads(boolean deserialized)
tryAllDownloads
in class ManagedDownloader
protected QueryRequest newRequery(int numRequeries) throws CantResumeException
newRequery
in class ManagedDownloader
numRequeries
- the number of requeries that have already happened
CantResumeException
- if this doesn't know what to search forprotected boolean allowAddition(RemoteFileDesc other)
allowAddition
in class ManagedDownloader
public java.lang.String getFileName()
getFileName
in interface Downloader
getFileName
in class ManagedDownloader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |