contentType = contentType.trim();
}
if (!("multipart/form-data".equals(contentType)))
throw new ServletException(sm.getString("coyoteRequest.notMultipart"));
DiskFileUpload fu = new DiskFileUpload();
fu.setRepositoryPath(config.getLocation());
if (config.getFileSizeThreshold() > 0) {
fu.setSizeThreshold(config.getFileSizeThreshold());
}
if (config.getMaxRequestSize() > 0) {
fu.setSizeMax(config.getMaxRequestSize());
}
if (config.getMaxFileSize() > 0) {
fu.setFileSizeMax(config.getMaxFileSize());
}
parts = new HashMap<String, Part>();
try {
for (FileItem fileItem : fu.parseRequest(getRequest())) {
if (fileItem.getFileName() == null) {
coyoteRequest.getParameters().addParameterValues(fileItem.getName(), new String[] {fileItem.getString()});
}
parts.put(fileItem.getName(), fileItem);
}