Interface Source

All Superinterfaces:
Serializable
All Known Implementing Classes:
ByteArraySource, OutputBarcode.Source

public interface Source extends Serializable
This class manages the source of a file. By using a ConcreteGate it is possible to download a file creating a very own personalized source implementing this class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the Source is compressible, false otherwise
    Returns the content type
    Returns the entity tag
    long
    Returns the content length
    default void
    input(UpFile upFile)
    Read the content of the passed uploaded file
    void
    Write in the OutputStream
  • Method Details

    • getCompressible

      boolean getCompressible()
      Returns true if the Source is compressible, false otherwise
      Returns:
      true if the Source is compressible, false otherwise
    • getEntityTag

      String getEntityTag()
      Returns the entity tag
      Returns:
      The entity tag
    • getContentType

      String getContentType()
      Returns the content type
      Returns:
      The content type
    • getLength

      long getLength()
      Returns the content length
      Returns:
      The content length in byte
    • output

      void output(OutputStream os) throws IOException
      Write in the OutputStream
      Parameters:
      os - The OutputStream
      Throws:
      IOException - if an I/O error occurs
    • input

      default void input(UpFile upFile) throws IOException
      Read the content of the passed uploaded file
      Parameters:
      upFile - instance of the uploaded file that is going to be saved
      Throws:
      IOException - in case of any error while saving the uploaded file