|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.api.Api
com.xpn.xwiki.plugin.PluginApi<FileUploadPlugin>
com.xpn.xwiki.plugin.fileupload.FileUploadPluginApi
public class FileUploadPluginApi
Plugin that offers access to uploaded files. The uploaded files are automatically parsed and preserved as a list of
FileItem
s. This is the wrapper accessible from in-document scripts.
Field Summary |
---|
Fields inherited from class com.xpn.xwiki.api.Api |
---|
context |
Constructor Summary | |
---|---|
FileUploadPluginApi(FileUploadPlugin plugin,
XWikiContext context)
API constructor. |
Method Summary | |
---|---|
void |
cleanFileList()
Deletes all temporary files of the upload. |
String |
getFileItem(String formfieldName)
Deprecated. not well named, use getFileItemAsString(String) |
String |
getFileItemAsString(String formfieldName)
Allows to retrieve the contents of an uploaded file as a string. |
byte[] |
getFileItemData(String formfieldName)
Allows to retrieve the contents of an uploaded file as a sequence of bytes. |
List<String> |
getFileItemNames()
Retrieves the list of FileItem names. |
List<org.apache.commons.fileupload.FileItem> |
getFileItems()
Allows to retrieve the current list of uploaded files, as a list of FileItem s. |
String |
getFileName(String formfieldName)
Get the name of the file uploaded for a form field. |
void |
loadFileList()
Loads the list of uploaded files in the context if there are any uploaded files. |
void |
loadFileList(long uploadMaxSize,
int uploadSizeThreashold,
String tempdir)
Loads the list of uploaded files in the context if there are any uploaded files. |
Methods inherited from class com.xpn.xwiki.plugin.PluginApi |
---|
getInternalPlugin, getProtectedPlugin, setPlugin |
Methods inherited from class com.xpn.xwiki.api.Api |
---|
convert, convert, convert, convertAttachments, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUploadPluginApi(FileUploadPlugin plugin, XWikiContext context)
plugin
- The wrapped plugin object.context
- Context of the request.PluginApi.PluginApi(com.xpn.xwiki.plugin.XWikiPluginInterface, XWikiContext)
Method Detail |
---|
public void cleanFileList()
public void loadFileList() throws XWikiException
XWikiException
- if the request could not be parsed, or the maximum file size was reached.public void loadFileList(long uploadMaxSize, int uploadSizeThreashold, String tempdir) throws XWikiException
uploadMaxSize
- Maximum size of the uploaded files.uploadSizeThreashold
- Threashold over which the file data should be stored on disk, and not in memory.tempdir
- Temporary directory to store the uploaded files that are not kept in memory.
XWikiException
- if the request could not be parsed, or the maximum file size was reached.public List<org.apache.commons.fileupload.FileItem> getFileItems()
FileItem
s. loadFileList()
needs to be called beforehand
public byte[] getFileItemData(String formfieldName) throws XWikiException
loadFileList()
needs to be
called beforehand.
formfieldName
- The name of the form field.
XWikiException
- if the data could not be read.@Deprecated public String getFileItem(String formfieldName) throws XWikiException
getFileItemAsString(String)
loadFileList()
needs to be called
beforehand.
formfieldName
- The name of the form field.
XWikiException
- Exception is thrown if the data could not be read.public String getFileItemAsString(String formfieldName) throws XWikiException
loadFileList()
needs to be called
beforehand.
formfieldName
- The name of the form field.
XWikiException
- if the data could not be read.public List<String> getFileItemNames()
loadFileList()
needs to be called beforehand.
public String getFileName(String formfieldName)
formfieldName
- The name of the form field.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |