org.apache.cocoon.servlet.multipart
Class MultipartParser

java.lang.Object
  extended by org.apache.cocoon.servlet.multipart.MultipartParser

public class MultipartParser
extends Object

This class is used to implement a multipart request wrapper. It will parse the http post stream and and fill it's hashtable with values. The hashtable will contain: Vector: inline part values FilePart: file part

Version:
CVS $Id: MultipartParser.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Jeroen ter Voorde

Field Summary
static String UPLOAD_STATUS_SESSION_ATTR
           
 
Constructor Summary
MultipartParser(boolean saveUploadedFilesToDisk, File uploadDirectory, boolean allowOverwrite, boolean silentlyRename, int maxUploadSize, String characterEncoding)
          Constructor, parses given request
 
Method Summary
 Hashtable getParts(HttpServletRequest request)
           
 Hashtable getParts(int contentLength, String contentType, InputStream requestStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPLOAD_STATUS_SESSION_ATTR

public static final String UPLOAD_STATUS_SESSION_ATTR
See Also:
Constant Field Values
Constructor Detail

MultipartParser

public MultipartParser(boolean saveUploadedFilesToDisk,
                       File uploadDirectory,
                       boolean allowOverwrite,
                       boolean silentlyRename,
                       int maxUploadSize,
                       String characterEncoding)
Constructor, parses given request

Parameters:
saveUploadedFilesToDisk - Write fileparts to the uploadDirectory. If true the corresponding object in the hashtable will contain a FilePartFile, if false a FilePartArray
uploadDirectory - The directory to write to if saveUploadedFilesToDisk is true.
allowOverwrite - Allow existing files to be overwritten.
silentlyRename - If file exists rename file (using filename+number).
maxUploadSize - The maximum content length accepted.
characterEncoding - The character encoding to be used.
Method Detail

getParts

public Hashtable getParts(int contentLength,
                          String contentType,
                          InputStream requestStream)
                   throws IOException,
                          MultipartException
Throws:
IOException
MultipartException

getParts

public Hashtable getParts(HttpServletRequest request)
                   throws IOException,
                          MultipartException
Throws:
IOException
MultipartException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.