Class DownloadUtils


  • public final class DownloadUtils
    extends java.lang.Object
    A utility class downloads the file from specified url.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void download​(java.lang.String url, java.lang.String output)
      Downloads a file from specified url.
      static void download​(java.lang.String url, java.lang.String output, ai.djl.util.Progress progress)
      Downloads a file from specified url.
      static void download​(java.net.URL url, java.nio.file.Path output, ai.djl.util.Progress progress)
      Downloads a file from specified url.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • download

        public static void download​(java.lang.String url,
                                    java.lang.String output)
                             throws java.io.IOException
        Downloads a file from specified url.
        Parameters:
        url - the url to download
        output - the output location
        Throws:
        java.io.IOException - when IO operation fails in downloading
      • download

        public static void download​(java.lang.String url,
                                    java.lang.String output,
                                    ai.djl.util.Progress progress)
                             throws java.io.IOException
        Downloads a file from specified url.
        Parameters:
        url - the url to download
        output - the output location
        progress - the progress tracker to show download progress
        Throws:
        java.io.IOException - when IO operation fails in downloading
      • download

        public static void download​(java.net.URL url,
                                    java.nio.file.Path output,
                                    ai.djl.util.Progress progress)
                             throws java.io.IOException
        Downloads a file from specified url.
        Parameters:
        url - the url to download
        output - the output location
        progress - the progress tracker to show download progress
        Throws:
        java.io.IOException - when IO operation fails in downloading