/*
* Hack for handling multipart requests.
*/
String contentType = getRequest().getContentType();
String method = getRequest().getMethod();
HTTPSettings webSettings = HTTPSettings.lookup();
if ("POST".equalsIgnoreCase(method) && contentType != null && contentType.startsWith("multipart") && webSettings.isMultipartProcessing()) {
log.debug("Found multipart request. Building wrapper");
String tmpDir = SessionTmpDirFactory.getTmpDir(getRequest());
if (log.isDebugEnabled())
log.debug("Extracting to dir " + tmpDir);
int maxSize = webSettings.getMaxPostSize() * 1024;
if (log.isDebugEnabled()) {
log.debug("Max post size is : " + maxSize + " bytes");
log.debug("Encoding is: " + webSettings.getEncoding());
}
try {
RequestMultipartWrapper wrap = new RequestMultipartWrapper(getRequest(), tmpDir, maxSize, webSettings.getEncoding());
log.debug("Multipart request parsed: ");
log.debug("getting files from request");
ControllerServletHelper.lookup().initThreadLocal(wrap, getResponse());
}
catch (IOException ioe) {