com.xpn.xwiki.plugin.fileupload
Class FileUploadPluginApi

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.plugin.PluginApi<FileUploadPlugin>
          extended by com.xpn.xwiki.plugin.fileupload.FileUploadPluginApi

Deprecated. the plugin technology is deprecated, consider rewriting as components

@Deprecated
public class FileUploadPluginApi
extends PluginApi<FileUploadPlugin>

Plugin that offers access to uploaded files. The uploaded files are automatically parsed and preserved as a list of FileItems. This is the wrapper accessible from in-document scripts.

Version:
$Id: d92831be623325f84c7d95ebd21dcc6a40db7383 $

Field Summary
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Constructor Summary
FileUploadPluginApi(FileUploadPlugin plugin, XWikiContext context)
          Deprecated. API constructor.
 
Method Summary
 void cleanFileList()
          Deprecated. Deletes all temporary files of the upload.
 String getFileItem(String formfieldName)
          Deprecated. not well named, use getFileItemAsString(String)
 String getFileItemAsString(String formfieldName)
          Deprecated. Allows to retrieve the contents of an uploaded file as a string.
 byte[] getFileItemData(String formfieldName)
          Deprecated. Allows to retrieve the contents of an uploaded file as a sequence of bytes.
 List<String> getFileItemNames()
          Deprecated. Retrieves the list of FileItem names.
 List<org.apache.commons.fileupload.FileItem> getFileItems()
          Deprecated. Allows to retrieve the current list of uploaded files, as a list of FileItems.
 String getFileName(String formfieldName)
          Deprecated. Get the name of the file uploaded for a form field.
 void loadFileList()
          Deprecated. Loads the list of uploaded files in the context if there are any uploaded files.
 void loadFileList(long uploadMaxSize, int uploadSizeThreashold, String tempdir)
          Deprecated. 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, 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

FileUploadPluginApi

public FileUploadPluginApi(FileUploadPlugin plugin,
                           XWikiContext context)
Deprecated. 
API constructor.

Parameters:
plugin - The wrapped plugin object.
context - Context of the request.
See Also:
PluginApi.PluginApi(com.xpn.xwiki.plugin.XWikiPluginInterface, XWikiContext)
Method Detail

cleanFileList

public void cleanFileList()
Deprecated. 
Deletes all temporary files of the upload.


loadFileList

public void loadFileList()
                  throws XWikiException
Deprecated. 
Loads the list of uploaded files in the context if there are any uploaded files.

Throws:
XWikiException - if the request could not be parsed, or the maximum file size was reached.

loadFileList

public void loadFileList(long uploadMaxSize,
                         int uploadSizeThreashold,
                         String tempdir)
                  throws XWikiException
Deprecated. 
Loads the list of uploaded files in the context if there are any uploaded files.

Parameters:
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.
Throws:
XWikiException - if the request could not be parsed, or the maximum file size was reached.

getFileItems

public List<org.apache.commons.fileupload.FileItem> getFileItems()
Deprecated. 
Allows to retrieve the current list of uploaded files, as a list of FileItems. loadFileList() needs to be called beforehand

Returns:
A list of FileItem elements.

getFileItemData

public byte[] getFileItemData(String formfieldName)
                       throws XWikiException
Deprecated. 
Allows to retrieve the contents of an uploaded file as a sequence of bytes. loadFileList() needs to be called beforehand.

Parameters:
formfieldName - The name of the form field.
Returns:
The contents of the file.
Throws:
XWikiException - if the data could not be read.

getFileItem

@Deprecated
public String getFileItem(String formfieldName)
                   throws XWikiException
Deprecated. not well named, use getFileItemAsString(String)

Allows to retrieve the contents of an uploaded file as a string. loadFileList() needs to be called beforehand.

Parameters:
formfieldName - The name of the form field.
Returns:
The contents of the file.
Throws:
XWikiException - Exception is thrown if the data could not be read.

getFileItemAsString

public String getFileItemAsString(String formfieldName)
                           throws XWikiException
Deprecated. 
Allows to retrieve the contents of an uploaded file as a string. loadFileList() needs to be called beforehand.

Parameters:
formfieldName - The name of the form field.
Returns:
The contents of the file.
Throws:
XWikiException - if the data could not be read.

getFileItemNames

public List<String> getFileItemNames()
Deprecated. 
Retrieves the list of FileItem names. loadFileList() needs to be called beforehand.

Returns:
List of strings of the item names

getFileName

public String getFileName(String formfieldName)
Deprecated. 
Get the name of the file uploaded for a form field.

Parameters:
formfieldName - The name of the form field.
Returns:
The file name, or null if no file was uploaded for that form field.


Copyright © 2004-2013 XWiki. All Rights Reserved.