bos.flush();
baos.flush();
bufIn.close();
bos.close();
UploadContext uploadContext = WSRPTypeFactory.createUploadContext(contentType, baos.toByteArray());
List<NamedString> mimeAttributes = new ArrayList<NamedString>(2);
NamedString mimeAttribute = new NamedString();
mimeAttribute.setName(FileUpload.CONTENT_DISPOSITION);
mimeAttribute.setValue(FileUpload.FORM_DATA + ";"
+ " name=\"" + item.getFieldName() + "\";"
+ " filename=\"" + item.getName() + "\"");
mimeAttributes.add(mimeAttribute);
mimeAttribute = new NamedString();
mimeAttribute.setName(FileUpload.CONTENT_TYPE);
mimeAttribute.setValue(item.getContentType());
mimeAttributes.add(mimeAttribute);
uploadContext.getMimeAttributes().addAll(mimeAttributes);
uploadContexts.add(uploadContext);
}
else
{