com.xpn.xwiki.plugin.fileupload
Class FileUploadPluginApi

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

public class FileUploadPluginApi
extends PluginApi


Field Summary
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Constructor Summary
FileUploadPluginApi(FileUploadPlugin plugin, XWikiContext context)
           
 
Method Summary
 void cleanFileList()
          Deletes all temporary files of the upload
 java.lang.String getFileItem(java.lang.String name)
          Allows to retrieve the data of FileItem named name loadFileList needs to be called beforehand
 byte[] getFileItemData(java.lang.String name)
          Allows to retrieve the data of FileItem named name loadFileList needs to be called beforehand
 java.util.List getFileItemNames()
          Allows to retrieve the list of FileItem names loadFileList needs to be called beforehand
 java.util.List getFileItems()
          Allows to retrieve the current FileItem list loadFileList needs to be called beforehand
 java.lang.String getFileName(java.lang.String name)
          Get file name from FileItem
 FileUploadPlugin getFileUploadPlugin()
           
 void loadFileList()
          Allows to load the file list in the context if there is a file upload Default uploadMaxSize, uploadSizeThreashold and temporary directory are used
 void loadFileList(long uploadMaxSize, int uploadSizeThreashold, java.lang.String tempdir)
          Allows to load the file list in the context if there is a file upload
 
Methods inherited from class com.xpn.xwiki.plugin.PluginApi
getPlugin, setPlugin
 
Methods inherited from class com.xpn.xwiki.api.Api
checkProgrammingRights, hasAccessLevel, hasAdminRights, hasProgrammingRights
 
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)
Method Detail

getFileUploadPlugin

public FileUploadPlugin getFileUploadPlugin()

cleanFileList

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


loadFileList

public void loadFileList()
                  throws XWikiException
Allows to load the file list in the context if there is a file upload Default uploadMaxSize, uploadSizeThreashold and temporary directory are used

Throws:
XWikiException - An XWikiException is thrown if the request could not be parser

loadFileList

public void loadFileList(long uploadMaxSize,
                         int uploadSizeThreashold,
                         java.lang.String tempdir)
                  throws XWikiException
Allows to load the file list in the context if there is a file upload

Parameters:
uploadMaxSize - Maximum size of the request
uploadSizeThreashold - Threashold over which the data should be on disk and not in memory
tempdir - Temporary Directory to store temp data
Throws:
XWikiException - An XWikiException is thrown if the request could not be parser

getFileItems

public java.util.List getFileItems()
Allows to retrieve the current FileItem list loadFileList needs to be called beforehand

Returns:
a list of FileItem elements

getFileItemData

public byte[] getFileItemData(java.lang.String name)
                       throws XWikiException
Allows to retrieve the data of FileItem named name loadFileList needs to be called beforehand

Parameters:
name - Name of the item
Returns:
byte[] of the data
Throws:
XWikiException - Exception is thrown if the data could not be read

getFileItem

public java.lang.String getFileItem(java.lang.String name)
                             throws XWikiException
Allows to retrieve the data of FileItem named name loadFileList needs to be called beforehand

Parameters:
name - Name of the item
Returns:
String of the data
Throws:
XWikiException - Exception is thrown if the data could not be read

getFileItemNames

public java.util.List getFileItemNames()
Allows to retrieve the list of FileItem names loadFileList needs to be called beforehand

Returns:
List of strings of the item names

getFileName

public java.lang.String getFileName(java.lang.String name)
Get file name from FileItem

Parameters:
name - of the field
Returns:
The file name


Copyright 2003 Ludovic Dubost