Collection<AttachmentDataSource> dss = new ArrayList<AttachmentDataSource>();
for (Attachment at : message.getAttachments()) {
if (at.getDataHandler().getDataSource() instanceof AttachmentDataSource) {
AttachmentDataSource ds = (AttachmentDataSource)at.getDataHandler().getDataSource();
try {
ds.hold();
} catch (IOException e) {
throw new Fault(e);
}
dss.add(ds);
}