Oracle interMedia Java Classes for Servlets and JSP API Reference
10g Release 1 (10.1)

Part No. B12249-01

oracle.ord.im
Class OrdMultipartWrapper

java.lang.Object
  |
  +--javax.servlet.ServletRequestWrapper
        |
        +--javax.servlet.http.HttpServletRequestWrapper
              |
              +--oracle.ord.im.OrdMultipartWrapper

public class OrdMultipartWrapper
extends javax.servlet.http.HttpServletRequestWrapper

The OrdMultipartWrapper class wraps the HttpServletRequest object and provides accesses to the contents in the HTTP request that is encoded using multipart/form-data encoding. This class overrides some of the methods in the HttpServletRequestWrapper class to provide access to the text-based form field parameters and defines new methods to provide access to the uploaded file(s).


Constructor Summary
OrdMultipartWrapper(javax.servlet.http.HttpServletRequest req, int maxMemory, java.lang.String tempDir)
          Create an OrdMultipartWrapper object that wraps the HttpServletRequest with multipart/form-data content.

 

Method Summary
 OrdHttpUploadFile getFileParameter(java.lang.String parameterName)
          Returns information about an uploaded file identified by parameter name as an OrdHttpUploadFile object.
 java.util.Enumeration getFileParameterNames()
          Returns an Enumeration of the names of all the input fields of type FILE in an HTML form.
 OrdHttpUploadFile[] getFileParameterValues(java.lang.String parameterName)
          Returns an array of OrdHttpUploadFile objects that represent all the files uploaded using the specified parameter name.
 java.lang.String getParameter(java.lang.String name)
          Overriden method from in HttpServletRequestWrapper class.
 java.util.Map getParameterMap()
          Overriden method from in HttpServletRequestWrapper class.
 java.util.Enumeration getParameterNames()
          Overriden method from in HttpServletRequestWrapper class.
 java.lang.String[] getParameterValues(java.lang.String name)
          Overriden method from in HttpServletRequestWrapper class.
 void release()
          Release the resources owned by an OrdMultipartWrapper object.

 

Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole

 

Methods inherited from class javax.servlet.ServletRequestWrapper
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest

 

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

 

Constructor Detail

OrdMultipartWrapper

public OrdMultipartWrapper(javax.servlet.http.HttpServletRequest req,
                           int maxMemory,
                           java.lang.String tempDir)
                    throws java.io.IOException
Create an OrdMultipartWrapper object that wraps the HttpServletRequest with multipart/form-data content.
Parameters:
req - an object of HttpServletRequest type.
maxMemory - an int that sepecifies the maximum amount of memeory to use by all uploaded files in a request before storing the uploaded file contents in the temporary directory.
tempDir - a String that specifies the temporary directory.
Method Detail

getParameterNames

public java.util.Enumeration getParameterNames()
Overriden method from in HttpServletRequestWrapper class.
Overrides:
getParameterNames in class javax.servlet.ServletRequestWrapper

getParameter

public java.lang.String getParameter(java.lang.String name)
Overriden method from in HttpServletRequestWrapper class.
Overrides:
getParameter in class javax.servlet.ServletRequestWrapper

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Overriden method from in HttpServletRequestWrapper class.
Overrides:
getParameterValues in class javax.servlet.ServletRequestWrapper

getParameterMap

public java.util.Map getParameterMap()
Overriden method from in HttpServletRequestWrapper class.
Overrides:
getParameterMap in class javax.servlet.ServletRequestWrapper

getFileParameter

public OrdHttpUploadFile getFileParameter(java.lang.String parameterName)
Returns information about an uploaded file identified by parameter name as an OrdHttpUploadFile object. Note that every input field of type FILE in an HTML form will produce a parameter of type OrdUploadFile, whether or not a user enters a valid file name into such a field.
Parameters:
parameterName - the name of the uploaded file parameter as a String.
Returns:
uploaded file parameter as an OrdHttpUploadFile object or null if the parameter does not exist.
Throws:
java.lang.IllegalStateException - if the ServletRequest object has not been specified, if the multipart form data has not been parsed, or if the upload request has been released.

getFileParameterValues

public OrdHttpUploadFile[] getFileParameterValues(java.lang.String parameterName)
Returns an array of OrdHttpUploadFile objects that represent all the files uploaded using the specified parameter name. Note that every input field of type FILE in an HTML form will produce a parameter of type OrdUploadFile, whether or not a user enters a valid file name into such a field.
Parameters:
parameterName - the name of the uploaded file parameter as a String.
Returns:
uploaded file parameters as an array of OrdHttpUploadFile objects or null if the parameter does not exist.
Throws:
java.lang.IllegalStateException - if the ServletRequest object has not been specified, if the multipart form data has not been parsed, or if the upload request has been released.

getFileParameterNames

public java.util.Enumeration getFileParameterNames()
Returns an Enumeration of the names of all the input fields of type FILE in an HTML form. Note that every input field of type FILE in an HTML form will produce a parameter of type OrdUploadFile, whether or not a user enters a valid file name into such a field. Returns an empty Enumeration if there are no input fields of type FILE.
Returns:
list of uploaded file parameter names as an Enumeration of Strings.
Throws:
java.lang.IllegalStateException - if the ServletRequest object has not been specified, if the multipart form data has not been parsed, or if the upload request has been released.

release

public void release()
Release the resources owned by an OrdMultipartWrapper object.

Oracle interMedia Java Classes for Servlets and JSP API Reference
10g Release 1 (10.1)

Part No. B12249-01

Copyright © 1999, 2003, Oracle. All Rights Reserved.