Class ByteArrayUploadable

java.lang.Object
jodd.http.upload.ByteArrayUploadable
All Implemented Interfaces:
Uploadable<byte[]>

public class ByteArrayUploadable extends Object implements Uploadable<byte[]>
Uploadable wrapper of byte array.
  • Field Details

    • byteArray

      protected final byte[] byteArray
    • fileName

      protected final String fileName
    • mimeType

      protected final String mimeType
  • Constructor Details

    • ByteArrayUploadable

      public ByteArrayUploadable(byte[] byteArray, String fileName)
    • ByteArrayUploadable

      public ByteArrayUploadable(byte[] byteArray, String fileName, String mimeType)
  • Method Details

    • getContent

      public byte[] getContent()
      Description copied from interface: Uploadable
      Returns the original content.
      Specified by:
      getContent in interface Uploadable<byte[]>
    • getBytes

      public byte[] getBytes()
      Description copied from interface: Uploadable
      Returns content bytes.
      Specified by:
      getBytes in interface Uploadable<byte[]>
    • getFileName

      public String getFileName()
      Description copied from interface: Uploadable
      Returns content file name. If null, the field's name will be used.
      Specified by:
      getFileName in interface Uploadable<byte[]>
    • getMimeType

      public String getMimeType()
      Description copied from interface: Uploadable
      Returns MIME type. If null, MIME type will be determined from file name's extension.
      Specified by:
      getMimeType in interface Uploadable<byte[]>
    • getSize

      public int getSize()
      Description copied from interface: Uploadable
      Returns size in bytes.
      Specified by:
      getSize in interface Uploadable<byte[]>
    • openInputStream

      public InputStream openInputStream()
      Description copied from interface: Uploadable
      Opens InputStream. User is responsible for closing it.
      Specified by:
      openInputStream in interface Uploadable<byte[]>