* {@link POITextExtractor} for each embeded file.
*/
public static POITextExtractor[] getEmbededDocsTextExtractors(POIOLE2TextExtractor ext) throws IOException {
// Find all the embeded directories
ArrayList dirs = new ArrayList();
POIFSFileSystem fs = ext.getFileSystem();
if(fs == null) {
throw new IllegalStateException("The extractor didn't know which POIFS it came from!");
}
if(ext instanceof ExcelExtractor) {
// These are in MBD... under the root
Iterator it = fs.getRoot().getEntries();
while(it.hasNext()) {
Entry entry = (Entry)it.next();
if(entry.getName().startsWith("MBD")) {
dirs.add(entry);
}
}
} else if(ext instanceof WordExtractor) {
// These are in ObjectPool -> _... under the root
try {
DirectoryEntry op = (DirectoryEntry)
fs.getRoot().getEntry("ObjectPool");
Iterator it = op.getEntries();
while(it.hasNext()) {
Entry entry = (Entry)it.next();
if(entry.getName().startsWith("_")) {
dirs.add(entry);