Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.dispatcher.multipart
Class JakartaMultiPartRequest

    java.lang.Object
      org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest

All Implemented Interfaces:
  MultiPartRequest

    public class JakartaMultiPartRequest

extends java.lang.Object
implements MultiPartRequest

Multipart form data request adapter for Jakarta Commons Fileupload package.

Field Summary
`protected java.util.List<java.lang.String>` | `errors`
`protected java.util.Map<java.lang.String,java.util.List<org.apache.commons.fileupload.FileItem>>` | `files`
`protected long` | `maxSize`
`protected java.util.Map<java.lang.String,java.util.List<java.lang.String>>` | `params`

Constructor Summary
`JakartaMultiPartRequest()`

Method Summary
`java.lang.String[]` | `getContentType(java.lang.String fieldName)` Returns the content type(s) of the file(s) associated with the specified field name (as supplied by the client browser), or `null` if no files are associated with the given field name.
`java.util.List` | `getErrors()` Returns a list of error messages that may have occurred while processing the request.
`java.io.File[]` | `getFile(java.lang.String fieldName)` Returns a `File` object for the filename specified or `null` if no files are associated with the given field name.
`java.lang.String[]` | `getFileNames(java.lang.String fieldName)` Returns a String[] of file names for files associated with the specified input field name
`java.util.Enumeration<java.lang.String>` | `getFileParameterNames()` Returns an enumeration of the parameter names for uploaded files
`java.lang.String[]` | `getFilesystemName(java.lang.String fieldName)` Returns the file system name(s) of files associated with the given field name or `null` if no files are associated with the given field name.
`java.lang.String` | `getParameter(java.lang.String name)` Returns the specified request parameter.
`java.util.Enumeration<java.lang.String>` | `getParameterNames()` Returns an enumeration of String parameter names.
`java.lang.String[]` | `getParameterValues(java.lang.String name)` Returns a list of all parameter values associated with a parameter name.
`void` | `parse(javax.servlet.http.HttpServletRequest request, java.lang.String saveDir)` Creates a new request wrapper to handle multi-part data using methods adapted from Jason Pell's multipart classes (see class description).
`void` | `setMaxSize(java.lang.String maxSize)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### files

    protected java.util.Map<java.lang.String,java.util.List<org.apache.commons.fileupload.FileItem>> files

### params

    protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> params

### errors

    protected java.util.List<java.lang.String> errors

### maxSize

    protected long maxSize

Constructor Detail

### JakartaMultiPartRequest

    public JakartaMultiPartRequest()

Method Detail

### setMaxSize

    public void setMaxSize(java.lang.String maxSize)

### parse

    public void parse(javax.servlet.http.HttpServletRequest request,
                      java.lang.String saveDir)
               throws java.io.IOException

  Creates a new request wrapper to handle multi-part data using methods adapted from Jason Pell's multipart classes (see class description).

  Specified by:
    `parse` in interface `MultiPartRequest`
  Parameters:
    `saveDir` - the directory to save off the file
    `request` - the request containing the multipart
  Throws:
    `java.io.IOException` - is thrown if encoding fails.

### getFileParameterNames

    public java.util.Enumeration<java.lang.String> getFileParameterNames()

  Description copied from interface: `MultiPartRequest`
  Returns an enumeration of the parameter names for uploaded files

  Specified by:
    `getFileParameterNames` in interface `MultiPartRequest`
  Returns:
    an enumeration of the parameter names for uploaded files

### getContentType

    public java.lang.String[] getContentType(java.lang.String fieldName)

  Description copied from interface: `MultiPartRequest`
  Returns the content type(s) of the file(s) associated with the specified field name (as supplied by the client browser), or `null` if no files are associated with the given field name.

  Specified by:
    `getContentType` in interface `MultiPartRequest`
  Parameters:
    `fieldName` - input field name
  Returns:
    an array of content encoding for the specified input field name or `null` if no content type was specified.

### getFile

    public java.io.File[] getFile(java.lang.String fieldName)

  Description copied from interface: `MultiPartRequest`
  Returns a `File` object for the filename specified or `null` if no files are associated with the given field name.

  Specified by:
    `getFile` in interface `MultiPartRequest`
  Parameters:
    `fieldName` - input field name
  Returns:
    a File[] object for files associated with the specified input field name

### getFileNames

    public java.lang.String[] getFileNames(java.lang.String fieldName)

  Description copied from interface: `MultiPartRequest`
  Returns a String[] of file names for files associated with the specified input field name

  Specified by:
    `getFileNames` in interface `MultiPartRequest`
  Parameters:
    `fieldName` - input field name
  Returns:
    a String[] of file names for files associated with the specified input field name

### getFilesystemName

    public java.lang.String[] getFilesystemName(java.lang.String fieldName)

  Description copied from interface: `MultiPartRequest`
  Returns the file system name(s) of files associated with the given field name or `null` if no files are associated with the given field name.

  Specified by:
    `getFilesystemName` in interface `MultiPartRequest`
  Parameters:
    `fieldName` - input field name
  Returns:
    the file system name(s) of files associated with the given field name

### getParameter

    public java.lang.String getParameter(java.lang.String name)

  Description copied from interface: `MultiPartRequest`
  Returns the specified request parameter.

  Specified by:
    `getParameter` in interface `MultiPartRequest`
  Parameters:
    `name` - the name of the parameter to get
  Returns:
    the parameter or `null` if it was not found.

### getParameterNames

    public java.util.Enumeration<java.lang.String> getParameterNames()

  Description copied from interface: `MultiPartRequest`
  Returns an enumeration of String parameter names.

  Specified by:
    `getParameterNames` in interface `MultiPartRequest`
  Returns:
    an enumeration of String parameter names.

### getParameterValues

    public java.lang.String[] getParameterValues(java.lang.String name)

  Description copied from interface: `MultiPartRequest`
  Returns a list of all parameter values associated with a parameter name. If there is only one parameter value per name the resulting array will be of length 1.

  Specified by:
    `getParameterValues` in interface `MultiPartRequest`
  Parameters:
    `name` - the name of the parameter.
  Returns:
    an array of all values associated with the parameter name.

### getErrors

    public java.util.List getErrors()

  Description copied from interface: `MultiPartRequest`
  Returns a list of error messages that may have occurred while processing the request. If there are no errors, an empty list is returned. If the underlying implementation (ie: pell, cos, jakarta, etc) cannot support providing these errors, an empty list is also returned. This list of errors is repoted back to the `MultiPartRequestWrapper`'s errors field.

  Specified by:
    `getErrors` in interface `MultiPartRequest`
  Returns:
    a list of Strings that represent various errors during parsing

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.