|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xpn.xwiki.plugin.XWikiDefaultPlugin com.xpn.xwiki.plugin.fileupload.FileUploadPlugin
@Deprecated public class FileUploadPlugin
Plugin that offers access to uploaded files. The uploaded files are automatically parsed and preserved as a list of
FileItem
s.
Field Summary | |
---|---|
static String |
FILE_LIST_KEY
Deprecated. The context name of the uploaded file list. |
static String |
PLUGIN_NAME
Deprecated. The name of the plugin; the key that can be used to retrieve this plugin from the context. |
static String |
UPLOAD_MAXSIZE_PARAMETER
Deprecated. The name of the parameter that can be set in the global XWiki preferences to override the default maximum file size. |
static String |
UPLOAD_SIZETHRESHOLD_PARAMETER
Deprecated. The name of the parameter that can be set in the global XWiki preferences to override the default size threshold for on-disk storage. |
Constructor Summary | |
---|---|
FileUploadPlugin(String name,
String className,
XWikiContext context)
Deprecated. |
Method Summary | |
---|---|
void |
cleanFileList(XWikiContext context)
Deprecated. Deletes all temporary files of the upload. |
void |
endRendering(XWikiContext context)
Deprecated. Hook method, called after the 1.0 rendering engine finished processing a wiki document. |
FileItem |
getFile(String formfieldName,
XWikiContext context)
Deprecated. Return the FileItem corresponding to the file uploaded for a form field. |
String |
getFileItem(String formfieldName,
XWikiContext context)
Deprecated. not well named, use getFileItemAsString(String, com.xpn.xwiki.XWikiContext) |
String |
getFileItemAsString(String formfieldName,
XWikiContext context)
Deprecated. Allows to retrieve the contents of an uploaded file as a string. |
byte[] |
getFileItemData(String formfieldName,
XWikiContext context)
Deprecated. Allows to retrieve the contents of an uploaded file as a sequence of bytes. |
InputStream |
getFileItemInputStream(String formfieldName,
XWikiContext context)
Deprecated. Allows to retrieve the contents of an uploaded file as a stream. |
List<String> |
getFileItemNames(XWikiContext context)
Deprecated. Retrieves the list of FileItem names. |
List<FileItem> |
getFileItems(XWikiContext context)
Deprecated. Allows to retrieve the current list of uploaded files, as a list of FileItem s. |
int |
getFileItemSize(String formfieldName,
XWikiContext context)
Deprecated. Retrieve the size of a file content in byte. |
String |
getFileName(String formfieldName,
XWikiContext context)
Deprecated. Get the name of the file uploaded for a form field. |
String |
getName()
Deprecated. The name which can be used for accessing this plugin from XWiki.getPlugin(String, XWikiContext) . |
Api |
getPluginApi(XWikiPluginInterface plugin,
XWikiContext context)
Deprecated. Get a public scriptable API that can be used to call methods of the (privileged) plugin. |
void |
init(XWikiContext context)
Deprecated. Global initialization, called when the platform is started and the plugin list is initialized. |
void |
loadFileList(long uploadMaxSize,
int uploadSizeThreashold,
String tempdir,
XWikiContext context)
Deprecated. Loads the list of uploaded files in the context if there are any uploaded files. |
void |
loadFileList(XWikiContext context)
Deprecated. Loads the list of uploaded files in the context if there are any uploaded files. |
void |
virtualInit(XWikiContext context)
Deprecated. Initialization method called each time a virtual wiki is started, allowing plugins to perform initialization tasks needed in each wiki. |
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin |
---|
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endParsing, endRenderingHandler, flushCache, flushCache, getClassName, insidePREHandler, outsidePREHandler, setClassName, setName, startRenderingHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PLUGIN_NAME
XWikiPluginInterface.getName()
,
Constant Field Valuespublic static final String FILE_LIST_KEY
public static final String UPLOAD_MAXSIZE_PARAMETER
public static final String UPLOAD_SIZETHRESHOLD_PARAMETER
Constructor Detail |
---|
public FileUploadPlugin(String name, String className, XWikiContext context)
name
- the plugin nameclassName
- the plugin classname (used in logs for example)context
- the XWiki ContextXWikiDefaultPlugin.XWikiDefaultPlugin(String,String,com.xpn.xwiki.XWikiContext)
Method Detail |
---|
public String getName()
XWikiPluginInterface
XWiki.getPlugin(String, XWikiContext)
.
getName
in interface XWikiPluginInterface
getName
in class XWikiDefaultPlugin
public void init(XWikiContext context)
XWikiPluginInterface
init
in interface XWikiPluginInterface
init
in class XWikiDefaultPlugin
context
- the current context, should not be stored since it will become mostly unreliable once the initial
request is terminatedpublic void virtualInit(XWikiContext context)
XWikiPluginInterface
virtualInit
in interface XWikiPluginInterface
virtualInit
in class XWikiDefaultPlugin
context
- the current request contextpublic Api getPluginApi(XWikiPluginInterface plugin, XWikiContext context)
XWikiPluginInterface
getPluginApi
in interface XWikiPluginInterface
getPluginApi
in class XWikiDefaultPlugin
plugin
- the plugin instance to wrapcontext
- the current request context
null
if the plugin doesn't want to expose a public APIpublic void endRendering(XWikiContext context)
endRendering
in interface XWikiPluginInterface
endRendering
in class XWikiDefaultPlugin
context
- the current request contextallows to also alter the rendering result
public void cleanFileList(XWikiContext context)
context
- Context of the request.FileUploadPluginApi.cleanFileList()
public void loadFileList(XWikiContext context) throws XWikiException
context
- Context of the request.
XWikiException
- An XWikiException is thrown if the request could not be parsed.FileUploadPluginApi.loadFileList()
public void loadFileList(long uploadMaxSize, int uploadSizeThreashold, String tempdir, XWikiContext context) 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.context
- Context of the request.
XWikiException
- if the request could not be parsed, or the maximum file size was reached.FileUploadPluginApi.loadFileList(long, int, String)
public List<FileItem> getFileItems(XWikiContext context)
FileItem
s.
loadFileList(XWikiContext)
needs to be called beforehand
context
- Context of the request.
FileUploadPluginApi.getFileItems()
public byte[] getFileItemData(String formfieldName, XWikiContext context) throws XWikiException
loadFileList(XWikiContext)
needs to be called beforehand.
formfieldName
- The name of the form field.context
- Context of the request.
XWikiException
- if the data could not be read.FileUploadPluginApi.getFileItemData(String)
public InputStream getFileItemInputStream(String formfieldName, XWikiContext context) throws IOException
loadFileList(XWikiContext)
needs to be
called beforehand.
formfieldName
- The name of the form field.context
- Context of the request.
IOException
- if I/O problem occurspublic int getFileItemSize(String formfieldName, XWikiContext context)
loadFileList(XWikiContext)
needs to be called beforehand.
formfieldName
- The name of the form field.context
- Context of the request.
public String getFileItemAsString(String formfieldName, XWikiContext context) throws XWikiException
loadFileList(XWikiContext)
needs to be
called beforehand.
formfieldName
- The name of the form field.context
- Context of the request.
XWikiException
- if the data could not be read.FileUploadPluginApi.getFileItemAsString(String)
@Deprecated public String getFileItem(String formfieldName, XWikiContext context) throws XWikiException
getFileItemAsString(String, com.xpn.xwiki.XWikiContext)
loadFileList(XWikiContext)
needs to be
called beforehand.
formfieldName
- The name of the form field.context
- Context of the request.
XWikiException
- Exception is thrown if the data could not be read.FileUploadPluginApi.getFileItemAsString(String)
public List<String> getFileItemNames(XWikiContext context)
loadFileList(XWikiContext)
needs to be called beforehand.
context
- Context of the request
public String getFileName(String formfieldName, XWikiContext context)
formfieldName
- The name of the form field.context
- Context of the request.
public FileItem getFile(String formfieldName, XWikiContext context)
formfieldName
- The name of the form field.context
- Context of the request.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |