java.lang.Object
com.flowingcode.vaadin.addons.uploadhelper.FileInfo
All Implemented Interfaces:
Serializable

public final class FileInfo extends Object implements Serializable
Represents a file in the file list of an Upload component.
See Also:
  • Constructor Details

    • FileInfo

      public FileInfo(Upload upload, String name)
      Constructs a FileInfo object with the specified upload and file name.
      Parameters:
      upload - the Upload instance representing the file upload source
      name - the name of the file being uploaded
    • FileInfo

      public FileInfo(FinishedEvent ev)
      Constructs a FileInfo object from the specified finished upload event.
      Parameters:
      ev - the FinishedEvent representing the succeeded or failed event
  • Method Details

    • update

      public void update()
      Updates this file in the upload component.
    • create

      public void create()
      Adds a new file to the upload component.
    • complete

      public FileInfo complete(Boolean complete)
      True if uploading is completed, false otherwise.
      Returns:
      This instance for method chaining
    • complete

      public FileInfo complete()
      Configure the upload in complete state (i.e. uploading is completed)
      Returns:
      This instance for method chaining
    • indeterminate

      public FileInfo indeterminate()
      Configure the upload in indeterminate state (i.e. the remaining time is unknown)
      Returns:
      This instance for method chaining
    • indeterminate

      public FileInfo indeterminate(Boolean indeterminate)
      True if the remaining time is unknown, false otherwise.
      Returns:
      This instance for method chaining
    • errorMessage

      public FileInfo errorMessage(String errorMessage)
      Error message returned by the server, if any.
      Returns:
      This instance for method chaining
    • progress

      public FileInfo progress(Integer progress)
      Number representing the uploading progress.
      Returns:
      This instance for method chaining
    • status

      public FileInfo status(String status)
      Uploading status message.
      Returns:
      This instance for method chaining
    • getName

      public String getName()
      Returns the name of the uploaded file.
    • getComplete

      public Boolean getComplete()
      Returns true if uploading is completed, false otherwise.
    • getIndeterminate

      public Boolean getIndeterminate()
      Returns true if the remaining progress is unknown, false otherwise.
    • getErrorMessage

      public String getErrorMessage()
      Returns the error message returned by the server.
    • getProgress

      public Integer getProgress()
      Returns a number between 0 and 100, representing the uploading progress.
    • getStatus

      public String getStatus()
      Returns the uploading status.