Package jodd.http.upload
Class ByteArrayUploadable
- java.lang.Object
-
- jodd.http.upload.ByteArrayUploadable
-
- All Implemented Interfaces:
Uploadable<byte[]>
public class ByteArrayUploadable extends java.lang.Object implements Uploadable<byte[]>
Uploadable wrapper ofbyte array.
-
-
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.StringgetFileName()Returns content file name.java.lang.StringgetMimeType()Returns MIME type.intgetSize()Returns size in bytes.java.io.InputStreamopenInputStream()OpensInputStream.
-
-
-
Method Detail
-
getContent
public byte[] getContent()
Description copied from interface:UploadableReturns the original content.- Specified by:
getContentin interfaceUploadable<byte[]>
-
getBytes
public byte[] getBytes()
Description copied from interface:UploadableReturns content bytes.- Specified by:
getBytesin interfaceUploadable<byte[]>
-
getFileName
public java.lang.String getFileName()
Description copied from interface:UploadableReturns content file name. Ifnull, the field's name will be used.- Specified by:
getFileNamein interfaceUploadable<byte[]>
-
getMimeType
public java.lang.String getMimeType()
Description copied from interface:UploadableReturns MIME type. Ifnull, MIME type will be determined fromfile name'sextension.- Specified by:
getMimeTypein interfaceUploadable<byte[]>
-
getSize
public int getSize()
Description copied from interface:UploadableReturns size in bytes.- Specified by:
getSizein interfaceUploadable<byte[]>
-
openInputStream
public java.io.InputStream openInputStream()
Description copied from interface:UploadableOpensInputStream. User is responsible for closing it.- Specified by:
openInputStreamin interfaceUploadable<byte[]>
-
-