}
attachments.appendChild(attachment);
logger.finer(String.format("Writing attachment file %s...",p.getFileName()));
attachmentFolder.mkdir(); // Does nothing if it already exists
try {
p.saveFile(new File(attachmentFolder, p.getFileName()));
} catch (IOException ex) {
logger.log(Level.WARNING, "Error decoding attachment; file may be corrupt!", ex);
}
attachmentFileNames.add(attachmentFolder.getCanonicalPath() + "/" + p.getFileName());
validAttachments = true;