Methods Summary |
---|
public ResourceDownloader | create(java.io.File file)
return( new ResourceDownloaderFileImpl( null, file ));
|
public ResourceDownloader | create(java.net.URL url)
if ( url.getProtocol().equalsIgnoreCase("file")){
try{
return( new ResourceDownloaderFileImpl( null, new File( new URI( url.toString()))));
}catch( Throwable e ){
return( new ResourceDownloaderURLImpl( null, url ));
}
}else{
return( new ResourceDownloaderURLImpl( null, url ));
}
|
public ResourceDownloader | create(java.net.URL url, java.lang.String postData)
return new ResourceDownloaderURLImpl(null, url, postData, false, null, null);
|
public ResourceDownloader | create(java.net.URL url, java.lang.String user_name, java.lang.String password)
return( new ResourceDownloaderURLImpl( null, url, user_name, password ));
|
public ResourceDownloader | create(ResourceDownloaderDelayedFactory factory)
return( new ResourceDownloaderDelayedImpl( null, factory ));
|
public ResourceDownloader | getAlternateDownloader(ResourceDownloader[] downloaders, int max_to_try)
return( getAlternateDownloader( downloaders, max_to_try, false ));
|
protected ResourceDownloader | getAlternateDownloader(ResourceDownloader[] downloaders, int max_to_try, boolean random)
ResourceDownloader res = new ResourceDownloaderAlternateImpl( null, downloaders, max_to_try, random );
return( res );
|
public ResourceDownloader | getAlternateDownloader(ResourceDownloader[] downloaders)
return( getAlternateDownloader( downloaders, -1, false ));
|
public ResourceDownloader | getMetaRefreshDownloader(ResourceDownloader downloader)
ResourceDownloader res = new ResourceDownloaderMetaRefreshImpl( null, downloader );
return( res );
|
public ResourceDownloader | getRandomDownloader(ResourceDownloader[] downloaders)
return( getAlternateDownloader( downloaders, -1, true ));
|
public ResourceDownloader | getRandomDownloader(ResourceDownloader[] downloaders, int max_to_try)
return( getAlternateDownloader( downloaders, max_to_try, true ));
|
public ResourceDownloader | getRetryDownloader(ResourceDownloader downloader, int retry_count)
ResourceDownloader res = new ResourceDownloaderRetryImpl( null, downloader, retry_count );
return( res );
|
public static ResourceDownloaderFactory | getSingleton()
return( singleton );
|
public ResourceDownloader | getSuffixBasedDownloader(ResourceDownloader _downloader)
ResourceDownloaderBaseImpl dl = (ResourceDownloaderBaseImpl)_downloader;
URL target = null;
while( true ){
List kids = dl.getChildren();
if ( kids.size() == 0 ){
target = ((ResourceDownloaderURLImpl)dl).getURL();
break;
}
dl = (ResourceDownloaderBaseImpl)kids.get(0);
}
if ( target == null ){
if (Logger.isEnabled())
Logger.log(new LogEvent(LOGID, "ResourceDownloader: suffix "
+ "based downloader failed to find leaf"));
return( _downloader );
}
if ( target.getPath().toLowerCase().endsWith(".torrent")){
return( getTorrentDownloader( _downloader, true ));
}else{
return( _downloader );
}
|
public ResourceDownloader | getTimeoutDownloader(ResourceDownloader downloader, int timeout_millis)
ResourceDownloader res = new ResourceDownloaderTimeoutImpl( null, downloader, timeout_millis );
return( res );
|
public ResourceDownloader | getTorrentDownloader(ResourceDownloader downloader, boolean persistent)
return( getTorrentDownloader( downloader, persistent, null ));
|
public ResourceDownloader | getTorrentDownloader(ResourceDownloader downloader, boolean persistent, java.io.File download_directory)
return( new ResourceDownloaderTorrentImpl( null, downloader, persistent, download_directory ));
|