Module bus.http

Class Downloads.Control

java.lang.Object
org.miaixz.bus.http.plugin.httpv.Downloads.Control
Enclosing class:
Downloads

public class Downloads.Control extends Object
Provides methods to control the state of an ongoing download.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Status indicating the download has been canceled.
    static final int
    Status indicating the download has completed successfully.
    static final int
    Status indicating the download is currently in progress.
    static final int
    Status indicating an error occurred during the download.
    static final int
    Status indicating the download has been paused by the user.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels the download if it is in progress or paused.
    void
    Pauses the download if it is currently in progress.
    void
    Resumes the download if it is currently paused.
    int
    Gets the current status of the download.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • STATUS__CANCELED

      public static final int STATUS__CANCELED
      Status indicating the download has been canceled. The partial file will be deleted.
      See Also:
    • STATUS__DOWNLOADING

      public static final int STATUS__DOWNLOADING
      Status indicating the download is currently in progress.
      See Also:
    • STATUS__PAUSED

      public static final int STATUS__PAUSED
      Status indicating the download has been paused by the user.
      See Also:
    • STATUS__DONE

      public static final int STATUS__DONE
      Status indicating the download has completed successfully.
      See Also:
    • STATUS__ERROR

      public static final int STATUS__ERROR
      Status 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.