Package com.ultikits.ultitools.utils
Class HttpDownloadUtils
java.lang.Object
com.ultikits.ultitools.utils.HttpDownloadUtils
Utility class for HTTP file download operations.
Provides methods to download files from URLs with progress tracking support.
- Since:
- 6.0.0
- Author:
- wisdomme
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceProgress callback interface for download operations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDownload file from URL.static voiddownload(String urlString, String fileName, String savePath, HttpDownloadUtils.ProgressCallback progressCallback) Download file from URL with progress callback.static byte[]downloadToByteArray(String urlString) Download content from URL to byte array.
-
Constructor Details
-
HttpDownloadUtils
public HttpDownloadUtils()
-
-
Method Details
-
download
Download file from URL.- Parameters:
urlString- Download URLfileName- File namesavePath- 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.- Parameters:
urlString- Download URLfileName- File namesavePath- Save pathprogressCallback- Progress callback- Throws:
IOException- if an I/O error occurs during download
-
downloadToByteArray
Download content from URL to byte array.- Parameters:
urlString- Download URL- Returns:
- Downloaded content as byte array
- Throws:
IOException- if an I/O error occurs during download
-