Package jodd.http.upload
Interface Uploadable<T>
-
- All Known Implementing Classes:
ByteArrayUploadable,FileUploadable
public interface Uploadable<T>Common interface of uploaded content forform parameters. All supported objects that can be uploaded using theHttpBase.form(String, Object)has to be wrapped with this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]getBytes()Returns content bytes.TgetContent()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
T getContent()
Returns the original content.
-
getBytes
byte[] getBytes()
Returns content bytes.
-
getFileName
java.lang.String getFileName()
Returns content file name. Ifnull, the field's name will be used.
-
getMimeType
java.lang.String getMimeType()
Returns MIME type. Ifnull, MIME type will be determined fromfile name'sextension.
-
getSize
int getSize()
Returns size in bytes.
-
openInputStream
java.io.InputStream openInputStream() throws java.io.IOExceptionOpensInputStream. User is responsible for closing it.- Throws:
java.io.IOException
-
-