HttpFileItem fileItem = new HttpFileItem(fac.createItem(item.getFieldName(),
item.getContentType(), item.isFormField(),
item.getName())
);
try {
MessageDigestInputStream in = new MessageDigestInputStream(
item.openStream(), algorithm);
Streams.copy(in, fileItem.getOutputStream(), true);
fileItem.setDigest(in.getDigest());
} catch (FileUploadIOException e) {
throw (FileUploadException) e.getCause();
} catch (IOException e) {
throw new IOFileUploadException(
"Processing of " + MULTIPART_FORM_DATA