Class ByteArrayUploadable

  • All Implemented Interfaces:
    Uploadable<byte[]>

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

      Fields 
      Modifier and Type Field Description
      protected byte[] byteArray  
      protected java.lang.String fileName  
      protected java.lang.String mimeType  
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteArrayUploadable​(byte[] byteArray, java.lang.String fileName)  
      ByteArrayUploadable​(byte[] byteArray, java.lang.String fileName, java.lang.String mimeType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getBytes()
      Returns content bytes.
      byte[] getContent()
      Returns the original content.
      java.lang.String getFileName()
      Returns content file name.
      java.lang.String getMimeType()
      Returns MIME type.
      int getSize()
      Returns size in bytes.
      java.io.InputStream openInputStream()
      Opens InputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • byteArray

        protected final byte[] byteArray
      • fileName

        protected final java.lang.String fileName
      • mimeType

        protected final java.lang.String mimeType
    • Constructor Detail

      • ByteArrayUploadable

        public ByteArrayUploadable​(byte[] byteArray,
                                   java.lang.String fileName)
      • ByteArrayUploadable

        public ByteArrayUploadable​(byte[] byteArray,
                                   java.lang.String fileName,
                                   java.lang.String mimeType)
    • Method Detail

      • 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 java.lang.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 java.lang.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 java.io.InputStream openInputStream()
        Description copied from interface: Uploadable
        Opens InputStream. User is responsible for closing it.
        Specified by:
        openInputStream in interface Uploadable<byte[]>