Class AsyncDownloader


  • public class AsyncDownloader
    extends java.lang.Object
    • Constructor Detail

      • AsyncDownloader

        public AsyncDownloader()
    • Method Detail

      • downloadFile

        public void downloadFile​(java.net.URL url,
                                 java.nio.file.Path target,
                                 long size)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • downloadFile

        public void downloadFile​(java.net.URL url,
                                 java.nio.file.Path target)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • downloadListInOneThread

        public void downloadListInOneThread​(java.util.List<AsyncDownloader.SizedFile> files,
                                            java.lang.String baseURL,
                                            java.nio.file.Path targetDir)
                                     throws java.net.URISyntaxException,
                                            java.io.IOException
        Throws:
        java.net.URISyntaxException
        java.io.IOException
      • downloadListInOneThreadSimple

        public void downloadListInOneThreadSimple​(java.util.List<AsyncDownloader.SizedFile> files,
                                                  java.lang.String baseURL,
                                                  java.nio.file.Path targetDir)
                                           throws java.net.URISyntaxException,
                                                  java.io.IOException
        Throws:
        java.net.URISyntaxException
        java.io.IOException
      • runDownloadList

        public java.util.concurrent.CompletableFuture[] runDownloadList​(java.util.List<java.util.List<AsyncDownloader.SizedFile>> files,
                                                                        java.lang.String baseURL,
                                                                        java.nio.file.Path targetDir,
                                                                        java.util.concurrent.Executor executor)
      • runDownloadListSimple

        public java.util.concurrent.CompletableFuture[] runDownloadListSimple​(java.util.List<java.util.List<AsyncDownloader.SizedFile>> files,
                                                                              java.lang.String baseURL,
                                                                              java.nio.file.Path targetDir,
                                                                              java.util.concurrent.Executor executor)
      • transfer

        public void transfer​(java.io.InputStream input,
                             java.nio.file.Path file,
                             long size)
                      throws java.io.IOException
        Throws:
        java.io.IOException