whitespace (tabs to spaces)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1753031 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0025b16e3e
commit
f92542e22e
@ -97,49 +97,49 @@ public class OLE2ScratchpadExtractorFactory {
|
|||||||
throw new IllegalArgumentException("No supported documents found in the OLE2 stream");
|
throw new IllegalArgumentException("No supported documents found in the OLE2 stream");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of text extractors, one for each of
|
* Returns an array of text extractors, one for each of
|
||||||
* the embedded documents in the file (if there are any).
|
* the embedded documents in the file (if there are any).
|
||||||
* If there are no embedded documents, you'll get back an
|
* If there are no embedded documents, you'll get back an
|
||||||
* empty array. Otherwise, you'll get one open
|
* empty array. Otherwise, you'll get one open
|
||||||
* {@link POITextExtractor} for each embedded file.
|
* {@link POITextExtractor} for each embedded file.
|
||||||
*/
|
*/
|
||||||
public static void identifyEmbeddedResources(POIOLE2TextExtractor ext, List<Entry> dirs, List<InputStream> nonPOIFS) throws IOException {
|
public static void identifyEmbeddedResources(POIOLE2TextExtractor ext, List<Entry> dirs, List<InputStream> nonPOIFS) throws IOException {
|
||||||
// Find all the embedded directories
|
// Find all the embedded directories
|
||||||
DirectoryEntry root = ext.getRoot();
|
DirectoryEntry root = ext.getRoot();
|
||||||
if(root == null) {
|
if(root == null) {
|
||||||
throw new IllegalStateException("The extractor didn't know which POIFS it came from!");
|
throw new IllegalStateException("The extractor didn't know which POIFS it came from!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ext instanceof WordExtractor) {
|
if(ext instanceof WordExtractor) {
|
||||||
// These are in ObjectPool -> _... under the root
|
// These are in ObjectPool -> _... under the root
|
||||||
try {
|
try {
|
||||||
DirectoryEntry op = (DirectoryEntry)
|
DirectoryEntry op = (DirectoryEntry)
|
||||||
root.getEntry("ObjectPool");
|
root.getEntry("ObjectPool");
|
||||||
Iterator<Entry> it = op.getEntries();
|
Iterator<Entry> it = op.getEntries();
|
||||||
while(it.hasNext()) {
|
while(it.hasNext()) {
|
||||||
Entry entry = it.next();
|
Entry entry = it.next();
|
||||||
if(entry.getName().startsWith("_")) {
|
if(entry.getName().startsWith("_")) {
|
||||||
dirs.add(entry);
|
dirs.add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(FileNotFoundException e) {
|
} catch(FileNotFoundException e) {
|
||||||
// ignored here
|
// ignored here
|
||||||
}
|
}
|
||||||
//} else if(ext instanceof PowerPointExtractor) {
|
//} else if(ext instanceof PowerPointExtractor) {
|
||||||
// Tricky, not stored directly in poifs
|
// Tricky, not stored directly in poifs
|
||||||
// TODO
|
// TODO
|
||||||
} else if(ext instanceof OutlookTextExtactor) {
|
} else if(ext instanceof OutlookTextExtactor) {
|
||||||
// Stored in the Attachment blocks
|
// Stored in the Attachment blocks
|
||||||
MAPIMessage msg = ((OutlookTextExtactor)ext).getMAPIMessage();
|
MAPIMessage msg = ((OutlookTextExtactor)ext).getMAPIMessage();
|
||||||
for(AttachmentChunks attachment : msg.getAttachmentFiles()) {
|
for(AttachmentChunks attachment : msg.getAttachmentFiles()) {
|
||||||
if(attachment.attachData != null) {
|
if(attachment.attachData != null) {
|
||||||
byte[] data = attachment.attachData.getValue();
|
byte[] data = attachment.attachData.getValue();
|
||||||
nonPOIFS.add( new ByteArrayInputStream(data) );
|
nonPOIFS.add( new ByteArrayInputStream(data) );
|
||||||
} else if(attachment.attachmentDirectory != null) {
|
} else if(attachment.attachmentDirectory != null) {
|
||||||
dirs.add(attachment.attachmentDirectory.getDirectory());
|
dirs.add(attachment.attachmentDirectory.getDirectory());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user