Class UploadInfo

java.lang.Object
org.deltava.beans.UploadInfo
All Implemented Interfaces:
Serializable, Cacheable

public class UploadInfo extends Object implements Cacheable
A bean to store resumable upload data.
Since:
7.5
Version:
7.5
Author:
Luke
See Also:
  • Constructor Details

    • UploadInfo

      public UploadInfo(int chunkSize, long totalSize)
      Creates the bean.
      Parameters:
      chunkSize - the chunk size in bytes
      totalSize - the total upload size in bytes
  • Method Details

    • getChunkSize

      public int getChunkSize()
      Returns the chunk size.
      Returns:
      the chunk size in bytes
    • length

      public long length()
      Returns the total upload length.
      Returns:
      the upload length in bytes
    • getID

      public String getID()
      Returns the upload ID.
      Returns:
      the ID
    • getFileName

      public String getFileName()
      Returns the upload file name.
      Returns:
      the file name
    • getTempFile

      public File getTempFile()
      Returns the temporary storage location.
      Returns:
      the temp File
    • getCreatedOn

      public Instant getCreatedOn()
      Returns the start time of the file upload.
      Returns:
      the start date/time
    • isComplete

      public boolean isComplete(int chunk)
      Returns whether a particular chunk has been uploaded.
      Parameters:
      chunk - the chunk number
      Returns:
      TRUE if uploaded, otherwise FALSE
    • isComplete

      public boolean isComplete()
      Returns whether all chunks have been uploaded.
      Returns:
      TRUE if all uploaded, otherwise FALSE
    • complete

      public void complete(int chunk)
      Marks a chunk as complete.
      Parameters:
      chunk - the chunk number
    • setID

      public void setID(String id)
      Sets the upload ID.
      Parameters:
      id - the ID
    • setFileName

      public void setFileName(String fName)
      Sets the upload filename.
      Parameters:
      fName - the file name
    • setTempFile

      public void setTempFile(File f)
      Updates the temporary storage location.
      Parameters:
      f - the temp File where chunks are written to
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object