Interface WebAPI.JSFile

Enclosing class:
WebAPI

public static interface WebAPI.JSFile
  • Property Details

    • progress

      javafx.beans.property.ReadOnlyDoubleProperty progressProperty
      Defines the progress of uploading the file. When the value is 1.0, then the upload is finished.
      See Also:
    • uploadedFile

      javafx.beans.property.ReadOnlyObjectProperty<File> uploadedFileProperty
      Contains the file, which was uploaded. It is null until progress reaches 1.0.
      See Also:
    • uploadStatus

      javafx.beans.property.ReadOnlyObjectProperty<WebAPI.UploadStatus> uploadStatusProperty
      The state of the upload. Progress is reset to 0 when the upload fails or is cancelled.
      Since:
      2026.3.2
      See Also:
  • Method Details

    • getFilename

      String getFilename()
    • getFileSize

      long getFileSize()
      Returns the size of the file in bytes.
    • getObjectURL

      JSVariable getObjectURL()
      Returns the Object URL representing the file. The Object URL is only valid as long as the JSFile is not garbage collected.
    • progressProperty

      javafx.beans.property.ReadOnlyDoubleProperty progressProperty()
      Defines the progress of uploading the file. When the value is 1.0, then the upload is finished.
      Returns:
      the progress property
      See Also:
    • uploadedFileProperty

      javafx.beans.property.ReadOnlyObjectProperty<File> uploadedFileProperty()
      Contains the file, which was uploaded. It is null until progress reaches 1.0.
      Returns:
      the uploadedFile property
      See Also:
    • getProgress

      default double getProgress()
      Gets the value of the property progress.
    • getUploadedFile

      default File getUploadedFile()
      Gets the value of the property uploadedFile.
    • uploadFile

      void uploadFile()
      Starts uploading the selected file. During upload, the progress property will slowly reach 1.0. After a failed or cancelled upload, calling it again starts a new attempt.
    • cancelUpload

      void cancelUpload()
      Stops a running upload. The status becomes WebAPI.UploadStatus.CANCELLED, progress is reset to 0, the future from getUploadedFileFuture() is cancelled and nothing is kept on the server. Does nothing unless the status is WebAPI.UploadStatus.UPLOADING.
      Since:
      2026.3.2
    • uploadStatusProperty

      javafx.beans.property.ReadOnlyObjectProperty<WebAPI.UploadStatus> uploadStatusProperty()
      The state of the upload. Progress is reset to 0 when the upload fails or is cancelled.
      Returns:
      the uploadStatus property
      Since:
      2026.3.2
      See Also:
    • getUploadStatus

      default WebAPI.UploadStatus getUploadStatus()
      Gets the value of the property uploadStatus.
      Since:
      2026.3.2
    • getUploadedFileFuture

      CompletableFuture<File> getUploadedFileFuture()
      This returns the file when the upload is finished. Calling this method, will trigger the upload, if it hasn't started yet. The future completes exceptionally with an IOException when the upload fails (for example when the server rejects the file) and is cancelled by cancelUpload(); cancelling the future stops the upload as well. After a failed or cancelled upload this returns that outcome; call uploadFile() to retry.
      Returns:
      future of the uploaded file