if (attachment.getAttachLongFileName() != null) { filename = attachment.getAttachLongFileName().getValue(); } else if (attachment.getAttachFileName() != null) { filename = attachment.getAttachFileName().getValue();
/** * Processes a single attachment: reads it from the Outlook MSG file and * writes it to disk as an individual file. * * @param attachment the chunk group describing the attachment * @param dir the directory in which to write the attachment file * @throws IOException when any of the file operations fails */ public void processAttachment(AttachmentChunks attachment, File dir) throws IOException { String fileName = attachment.getAttachFileName().toString(); if(attachment.getAttachLongFileName() != null) { fileName = attachment.getAttachLongFileName().toString(); } File f = new File(dir, fileName); OutputStream fileOut = null; try { fileOut = new FileOutputStream(f); fileOut.write(attachment.getAttachData().getValue()); } finally { if(fileOut != null) { fileOut.close(); } } }
if (name == null) name = att.getAttachFileName(); String attName = name == null ? null : name.getValue();
if (attachment.getAttachLongFileName() != null) { filename = attachment.getAttachLongFileName().getValue(); } else if (attachment.getAttachFileName() != null) { filename = attachment.getAttachFileName().getValue();
if (attachment.getAttachLongFileName() != null) { filename = attachment.getAttachLongFileName().getValue(); } else if (attachment.getAttachFileName() != null) { filename = attachment.getAttachFileName().getValue();
if (attachment.getAttachLongFileName() != null) { filename = attachment.getAttachLongFileName().getValue(); } else if (attachment.getAttachFileName() != null) { filename = attachment.getAttachFileName().getValue();