Package pro.gravit.launcher
Class AsyncDownloader
java.lang.Object
pro.gravit.launcher.AsyncDownloader
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AsyncDownloader.Callbackstatic final AsyncDownloader.Callbackboolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddownloadFile(URL url, Path target) voiddownloadFile(URL url, Path target, long size) voiddownloadListInOneThread(List<AsyncDownloader.SizedFile> files, String baseURL, Path targetDir) voiddownloadListInOneThreadSimple(List<AsyncDownloader.SizedFile> files, String baseURL, Path targetDir) static SSLContextstatic SSLSocketFactoryrunDownloadList(List<List<AsyncDownloader.SizedFile>> files, String baseURL, Path targetDir, Executor executor) runDownloadListSimple(List<List<AsyncDownloader.SizedFile>> files, String baseURL, Path targetDir, Executor executor) sortFiles(List<AsyncDownloader.SizedFile> files, int threads) voidtransfer(InputStream input, Path file, long size)
-
Field Details
-
IGNORE
-
callback
-
isClosed
public volatile boolean isClosed
-
-
Constructor Details
-
AsyncDownloader
-
AsyncDownloader
public AsyncDownloader()
-
-
Method Details
-
makeSSLSocketFactory
public static SSLSocketFactory makeSSLSocketFactory() throws NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException, KeyManagementException -
makeSSLContext
public static SSLContext makeSSLContext() throws NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException, KeyManagementException -
downloadFile
- Throws:
IOException
-
downloadFile
- Throws:
IOException
-
downloadListInOneThread
public void downloadListInOneThread(List<AsyncDownloader.SizedFile> files, String baseURL, Path targetDir) throws URISyntaxException, IOException - Throws:
URISyntaxExceptionIOException
-
downloadListInOneThreadSimple
public void downloadListInOneThreadSimple(List<AsyncDownloader.SizedFile> files, String baseURL, Path targetDir) throws URISyntaxException, IOException - Throws:
URISyntaxExceptionIOException
-
sortFiles
public List<List<AsyncDownloader.SizedFile>> sortFiles(List<AsyncDownloader.SizedFile> files, int threads) -
runDownloadList
public CompletableFuture[] runDownloadList(List<List<AsyncDownloader.SizedFile>> files, String baseURL, Path targetDir, Executor executor) -
runDownloadListSimple
public CompletableFuture[] runDownloadListSimple(List<List<AsyncDownloader.SizedFile>> files, String baseURL, Path targetDir, Executor executor) -
transfer
- Throws:
IOException
-