public class FileUploadable extends java.lang.Object implements Uploadable<java.io.File>
Modifier and Type | Field and Description |
---|---|
protected java.io.File |
file |
protected java.lang.String |
fileName |
protected java.lang.String |
mimeType |
Constructor and Description |
---|
FileUploadable(java.io.File file) |
FileUploadable(java.io.File file,
java.lang.String fileName,
java.lang.String mimeType) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Returns content bytes.
|
java.io.File |
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 . |
protected final java.io.File file
protected final java.lang.String fileName
protected final java.lang.String mimeType
public FileUploadable(java.io.File file)
public FileUploadable(java.io.File file, java.lang.String fileName, java.lang.String mimeType)
public java.io.File getContent()
Uploadable
getContent
in interface Uploadable<java.io.File>
public byte[] getBytes()
Uploadable
getBytes
in interface Uploadable<java.io.File>
public java.lang.String getFileName()
Uploadable
null
, the field's name will be used.getFileName
in interface Uploadable<java.io.File>
public java.lang.String getMimeType()
Uploadable
null
,
MIME type will be determined from
file name's
extension.getMimeType
in interface Uploadable<java.io.File>
public int getSize()
Uploadable
getSize
in interface Uploadable<java.io.File>
public java.io.InputStream openInputStream() throws java.io.IOException
Uploadable
InputStream
. User is responsible
for closing it.openInputStream
in interface Uploadable<java.io.File>
java.io.IOException
Copyright © 2003-present Jodd Team