org.objectweb.telosys.upload
Class MultipartRequest

java.lang.Object
  extended byorg.objectweb.telosys.upload.MultipartRequest

public class MultipartRequest
extends java.lang.Object

Multipart request manager
Parses the given HttpServletRequest and holds all the parts contained in the request.
Provides "file parts" and "parameter part"


Field Summary
static java.lang.String MULTIPART
           
 
Constructor Summary
MultipartRequest(javax.servlet.http.HttpServletRequest request)
          Constructor with default max post size ( 100 Mb )
MultipartRequest(javax.servlet.http.HttpServletRequest request, long maxPostSize)
          Constructor with generic max post size
 
Method Summary
 Part getFile(java.lang.String name)
          Returns the "file part" from the given name
The "name" parameter is the HTML "name" attribute of the "input" tag ( i.e. input type="file" name="file" )
 java.util.Enumeration getFileNames()
          Returns all the names of the "file parts" held
 Part getParameter(java.lang.String name)
          Returns the "parameter part" from the given name
 java.util.Enumeration getParameterNames()
          Returns all the names of the "parameter parts" held
static boolean isMultipartContent(javax.servlet.http.HttpServletRequest request)
          Check if the given http request is really "multipart"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MULTIPART

public static final java.lang.String MULTIPART
See Also:
Constant Field Values
Constructor Detail

MultipartRequest

public MultipartRequest(javax.servlet.http.HttpServletRequest request)
                 throws java.io.IOException
Constructor with default max post size ( 100 Mb )

Parameters:
request -
Throws:
java.io.IOException

MultipartRequest

public MultipartRequest(javax.servlet.http.HttpServletRequest request,
                        long maxPostSize)
                 throws java.io.IOException
Constructor with generic max post size

Parameters:
request -
maxPostSize -
Throws:
java.io.IOException
Method Detail

getParameterNames

public java.util.Enumeration getParameterNames()
Returns all the names of the "parameter parts" held

Returns:

getFileNames

public java.util.Enumeration getFileNames()
Returns all the names of the "file parts" held

Returns:

getParameter

public Part getParameter(java.lang.String name)
Returns the "parameter part" from the given name

Parameters:
name -
Returns:

getFile

public Part getFile(java.lang.String name)
Returns the "file part" from the given name
The "name" parameter is the HTML "name" attribute of the "input" tag ( i.e. input type="file" name="file" )

Parameters:
name -
Returns:

isMultipartContent

public static final boolean isMultipartContent(javax.servlet.http.HttpServletRequest request)
Check if the given http request is really "multipart"

Parameters:
request -
Returns:
: true if "multipart", else false