public class LocalFileAwareDownloader extends java.lang.Object implements Downloader
Downloader that handles file:/// URLs. Such URLs can
be used for testing.| Constructor and Description |
|---|
LocalFileAwareDownloader(Downloader delegate) |
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
downloadAndStream(java.net.URL url,
ProgressIndicator indicator)
Gets a stream associated with the content at the given URL.
|
void |
downloadFully(java.net.URL url,
java.io.File target,
java.lang.String checksum,
ProgressIndicator indicator)
Downloads the content at the given URL to the given file.
|
java.io.File |
downloadFully(java.net.URL url,
ProgressIndicator indicator)
Downloads the content at the given URL to a temporary file and returns a handle to that file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithashpublic LocalFileAwareDownloader(@NonNull
Downloader delegate)
@Nullable
public java.io.InputStream downloadAndStream(@NonNull
java.net.URL url,
@NonNull
ProgressIndicator indicator)
throws java.io.IOException
DownloaderdownloadAndStream in interface Downloaderurl - The URL to fetch.indicator - Facility for showing download progress and logging.null if the
download is cancelled.java.io.IOException@Nullable
public java.io.File downloadFully(@NonNull
java.net.URL url,
@NonNull
ProgressIndicator indicator)
throws java.io.IOException
DownloaderdownloadFully in interface Downloaderurl - The URL to fetch.indicator - Facility for showing download progress and logging.null if the download is cancelled.java.io.IOExceptionpublic void downloadFully(@NonNull
java.net.URL url,
@NonNull
java.io.File target,
@Nullable
java.lang.String checksum,
@NonNull
ProgressIndicator indicator)
throws java.io.IOException
DownloaderdownloadFully in interface Downloaderurl - The URL to fetch.target - The location to download to.checksum - If specified, first check target to see if the given checksum
matches the existing file. If so, returns immediately.indicator - Facility for showing download progress and logging.java.io.IOException