Class HttpDownloadUtils

java.lang.Object
com.ultikits.ultitools.utils.HttpDownloadUtils

public class HttpDownloadUtils extends Object
Utility class for HTTP file download operations. Provides methods to download files from URLs with progress tracking support.
HTTP文件下载操作的实用工具类。 提供从URL下载文件的方法,支持进度跟踪。
Since:
6.0.0
Author:
wisdomme
  • Constructor Details

    • HttpDownloadUtils

      public HttpDownloadUtils()
  • Method Details

    • download

      public static void download(String urlString, String fileName, String savePath) throws IOException
      Download file from URL.
      从URL下载文件。
      Parameters:
      urlString - Download URL
      下载地址
      fileName - File name
      文件名
      savePath - Save path
      保存路径
      Throws:
      IOException - if an I/O error occurs during download
    • download

      public static void download(String urlString, String fileName, String savePath, HttpDownloadUtils.ProgressCallback progressCallback) throws IOException
      Download file from URL with progress callback.
      从URL下载文件并提供进度回调。
      Parameters:
      urlString - Download URL
      下载地址
      fileName - File name
      文件名
      savePath - Save path
      保存路径
      progressCallback - Progress callback
      进度回调
      Throws:
      IOException - if an I/O error occurs during download
    • downloadToByteArray

      public static byte[] downloadToByteArray(String urlString) throws IOException
      Download content from URL to byte array.
      从URL下载内容到字节数组。
      Parameters:
      urlString - Download URL
      下载地址
      Returns:
      Downloaded content as byte array
      下载的内容作为字节数组
      Throws:
      IOException - if an I/O error occurs during download