public static FormData getFormData(HttpServletRequest request) {
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload( factory );
upload.setHeaderEncoding( "UTF-8" );
FormData data = new FormData();
try {
List items = upload.parseRequest( request );
Iterator it = items.iterator();
while ( it.hasNext() ) {
FileItem item = (FileItem) it.next();
if ( item.isFormField() && item.getFieldName().equals( HTMLFileManagerFields.FORM_FIELD_UUID ) ) {
data.setUuid( item.getString() );
} else if ( !item.isFormField() ) {
data.setFile( item );
}
}
return data;
} catch ( FileUploadException e ) {
throw new RulesRepositoryException( e );