java.lang.Object
org.miaixz.bus.http.plugin.httpv.Downloads.Control
- Enclosing class:
Downloads
Provides methods to control the state of an ongoing download.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intStatus indicating the download has been canceled.static final intStatus indicating the download has completed successfully.static final intStatus indicating the download is currently in progress.static final intStatus indicating an error occurred during the download.static final intStatus indicating the download has been paused by the user. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
STATUS__CANCELED
public static final int STATUS__CANCELEDStatus indicating the download has been canceled. The partial file will be deleted.- See Also:
-
STATUS__DOWNLOADING
public static final int STATUS__DOWNLOADINGStatus indicating the download is currently in progress.- See Also:
-
STATUS__PAUSED
public static final int STATUS__PAUSEDStatus indicating the download has been paused by the user.- See Also:
-
STATUS__DONE
public static final int STATUS__DONEStatus indicating the download has completed successfully.- See Also:
-
STATUS__ERROR
public static final int STATUS__ERRORStatus indicating an error occurred during the download.- See Also:
-
-
Constructor Details
-
Control
public Control()
-
-
Method Details
-
status
public int status()Gets the current status of the download.- Returns:
- The current status code.
- See Also:
-
pause
public void pause()Pauses the download if it is currently in progress. -
resume
public void resume()Resumes the download if it is currently paused. -
cancel
public void cancel()Cancels the download if it is in progress or paused. The partially downloaded file will be deleted.
-