Class LegacyDownloader

  • All Implemented Interfaces:
    com.android.repository.api.Downloader

    public class LegacyDownloader
    extends java.lang.Object
    implements com.android.repository.api.Downloader
    A Downloader implementation that uses the old DownloadCache. TODO: Implement a new, fully-featured downloader, then mark this as deprecated.
    • Constructor Summary

      Constructors 
      Constructor Description
      LegacyDownloader​(com.android.repository.io.FileOp fop, com.android.repository.api.SettingsController settings)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.InputStream downloadAndStream​(java.net.URL url, com.android.repository.api.ProgressIndicator indicator)  
      java.nio.file.Path downloadFully​(java.net.URL url, com.android.repository.api.ProgressIndicator indicator)  
      void downloadFully​(java.net.URL url, java.nio.file.Path target, com.android.repository.api.Checksum checksum, com.android.repository.api.ProgressIndicator indicator)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.android.repository.api.Downloader

        downloadFullyWithCaching, setDownloadIntermediatesLocation
    • Constructor Detail

      • LegacyDownloader

        public LegacyDownloader​(@NonNull
                                com.android.repository.io.FileOp fop,
                                @NonNull
                                com.android.repository.api.SettingsController settings)
    • Method Detail

      • downloadAndStream

        @Nullable
        public java.io.InputStream downloadAndStream​(@NonNull
                                                     java.net.URL url,
                                                     @NonNull
                                                     com.android.repository.api.ProgressIndicator indicator)
                                              throws java.io.IOException
        Specified by:
        downloadAndStream in interface com.android.repository.api.Downloader
        Throws:
        java.io.IOException
      • downloadFully

        @Nullable
        public java.nio.file.Path downloadFully​(@NonNull
                                                java.net.URL url,
                                                @NonNull
                                                com.android.repository.api.ProgressIndicator indicator)
                                         throws java.io.IOException
        Specified by:
        downloadFully in interface com.android.repository.api.Downloader
        Throws:
        java.io.IOException
      • downloadFully

        public void downloadFully​(@NonNull
                                  java.net.URL url,
                                  @NonNull
                                  java.nio.file.Path target,
                                  @Nullable
                                  com.android.repository.api.Checksum checksum,
                                  @NonNull
                                  com.android.repository.api.ProgressIndicator indicator)
                           throws java.io.IOException
        Specified by:
        downloadFully in interface com.android.repository.api.Downloader
        Throws:
        java.io.IOException