|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.deepamehta.plugins.files.UploadedFile
public class UploadedFile
An uploaded file.
Files are uploaded via the REST API by POSTing multipart/form-data
to a resource method
which consumes multipart/form-data
and has UploadedFile as its entity parameter.
Client-side support: the public API of the Files plugin provides a method
dm4c.get_plugin("de.deepamehta.files").open_upload_dialog()
that allows the user to
choose and upload a file.
Field Summary | |
---|---|
private org.apache.commons.fileupload.FileItem |
fileItem
|
Constructor Summary | |
---|---|
UploadedFile(org.apache.commons.fileupload.FileItem fileItem)
|
Method Summary | |
---|---|
byte[] |
getBytes()
Returns the contents of the uploaded file as an array of bytes. |
InputStream |
getInputStream()
Returns an InputStream that can be used to retrieve the contents of the uploaded file. |
String |
getMediaType()
Returns the content type passed by the browser or null if not defined. |
String |
getName()
Returns the original filename in the client's filesystem, as provided by the browser (or other client software). |
long |
getSize()
Returns the size of the file. |
String |
getString()
Returns the contents of the uploaded file as a String, using the default character encoding. |
String |
getString(String encoding)
Returns the contents of the uploaded file as a String, using the specified encoding. |
String |
toString()
|
void |
write(File file)
A convenience method to write the uploaded file to disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private org.apache.commons.fileupload.FileItem fileItem
Constructor Detail |
---|
public UploadedFile(org.apache.commons.fileupload.FileItem fileItem)
Method Detail |
---|
public String getName()
public long getSize()
public String getMediaType()
null
if not defined.
public String getString()
public String getString(String encoding)
public byte[] getBytes()
public InputStream getInputStream()
public void write(File file)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |