r.displayName = (chunks.recipientDisplayNameChunk != null) ? chunks.recipientDisplayNameChunk.toString() : null; r.name = (chunks.recipientNameChunk != null) ? chunks.recipientNameChunk.toString() : null; r.emailAddress = chunks.getRecipientEmailAddress(); List<PropertyValue> vals = chunks.getProperties().get(MAPIProperty.RECIPIENT_TYPE);
/** * 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(); } } }
r.displayName = (chunks.recipientDisplayNameChunk != null) ? chunks.recipientDisplayNameChunk.toString() : null; r.name = (chunks.recipientNameChunk != null) ? chunks.recipientNameChunk.toString() : null; r.emailAddress = chunks.getRecipientEmailAddress(); List<PropertyValue> vals = chunks.getProperties().get(MAPIProperty.RECIPIENT_TYPE);
r.displayName = (chunks.recipientDisplayNameChunk != null) ? chunks.recipientDisplayNameChunk.toString() : null; r.name = (chunks.recipientNameChunk != null) ? chunks.recipientNameChunk.toString() : null; r.emailAddress = chunks.getRecipientEmailAddress(); List<PropertyValue> vals = chunks.getProperties().get(MAPIProperty.RECIPIENT_TYPE);