Package org.apache.jackrabbit.oak.run
Class Downloader
- java.lang.Object
-
- org.apache.jackrabbit.oak.run.Downloader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class Downloader extends Object implements Closeable
Generic concurrent file downloader which uses Java NIO channels to potentially leverage OS internal optimizations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Downloader.DownloadReport
static class
Downloader.Item
-
Constructor Summary
Constructors Constructor Description Downloader(int concurrency, int connectTimeoutMs, int readTimeoutMs)
Downloader(int concurrency, int connectTimeoutMs, int readTimeoutMs, int maxRetries, long retryInitialInterval, boolean failOnError, int slowLogThreshold, String checksumAlgorithm, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
offer(Downloader.Item item)
Downloader.DownloadReport
waitUntilComplete()
-
-
-
Constructor Detail
-
Downloader
public Downloader(int concurrency, int connectTimeoutMs, int readTimeoutMs)
-
Downloader
public Downloader(int concurrency, int connectTimeoutMs, int readTimeoutMs, int maxRetries, long retryInitialInterval, boolean failOnError, int slowLogThreshold, String checksumAlgorithm, int bufferSize)
-
-
Method Detail
-
offer
public void offer(Downloader.Item item)
-
waitUntilComplete
public Downloader.DownloadReport waitUntilComplete()
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-