if (attachment.getAttachLongFileName() != null) { filename = attachment.getAttachLongFileName().getValue(); } else if (attachment.getAttachFileName() != null) { filename = attachment.getAttachFileName().getValue(); if (attachment.getAttachData() != null) { handleEmbeddedResource( TikaInputStream.get(attachment.getAttachData().getValue()), filename, null, null, xhtml, true ); if (attachment.getAttachmentDirectory() != null) { handleEmbeddedOfficeDoc( attachment.getAttachmentDirectory().getDirectory(), xhtml );
@Override public Chunk[] getChunks() { return getAll(); }
/** * 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(); } } }
StringChunk name = att.getAttachLongFileName(); if (name == null) name = att.getAttachFileName(); String attName = name == null ? null : name.getValue(); if(att.getAttachMimeTag() != null && att.getAttachMimeTag().getValue() != null) { attName = att.getAttachMimeTag().getValue() + " = " + attName;
if (attachment.getAttachData() != null) { byte[] data = attachment.getAttachData().getValue(); nonPOIFS.add( new ByteArrayInputStream(data) ); } else if (attachment.getAttachmentDirectory() != null) { dirs.add(attachment.getAttachmentDirectory().getDirectory());
group = new AttachmentChunks(dir.getName());
group = new AttachmentChunks(dir.getName());
if (attachment.getAttachLongFileName() != null) { filename = attachment.getAttachLongFileName().getValue(); } else if (attachment.getAttachFileName() != null) { filename = attachment.getAttachFileName().getValue(); if (attachment.getAttachData() != null) { handleEmbeddedResource( TikaInputStream.get(attachment.getAttachData().getValue()), filename, null, null, xhtml, true ); if (attachment.getAttachmentDirectory() != null) { handleEmbeddedOfficeDoc( attachment.getAttachmentDirectory().getDirectory(), xhtml );
public Chunk[] getChunks() { return getAll(); }
if (attachment.getAttachLongFileName() != null) { filename = attachment.getAttachLongFileName().getValue(); } else if (attachment.getAttachFileName() != null) { filename = attachment.getAttachFileName().getValue(); if (attachment.getAttachData() != null) { handleEmbeddedResource( TikaInputStream.get(attachment.getAttachData().getValue()), filename, null, null, xhtml, true ); if (attachment.getAttachmentDirectory() != null) { handleEmbeddedOfficeDoc( attachment.getAttachmentDirectory().getDirectory(), xhtml );
if (attachment.getAttachLongFileName() != null) { filename = attachment.getAttachLongFileName().getValue(); } else if (attachment.getAttachFileName() != null) { filename = attachment.getAttachFileName().getValue(); if (attachment.getAttachData() != null) { handleEmbeddedResource( TikaInputStream.get(attachment.getAttachData().getValue()), filename, null, null, xhtml, true ); if (attachment.getAttachmentDirectory() != null) { handleEmbeddedOfficeDoc( attachment.getAttachmentDirectory().getDirectory(), xhtml );