mirror of https://github.com/apache/poi.git
move string literals out to array that can be for-looped over
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1752053 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
848f056369
commit
103116bff9
|
@ -327,19 +327,24 @@ public class ExtractorFactory {
|
||||||
return new PublisherTextExtractor(poifsDir);
|
return new PublisherTextExtractor(poifsDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (poifsDir.hasEntry("__substg1.0_1000001E") || poifsDir.hasEntry("__substg1.0_1000001F")
|
final String[] outlookEntryNames = new String[] {
|
||||||
|| poifsDir.hasEntry("__substg1.0_0047001E")
|
// message bodies, saved as plain text (PtypString)
|
||||||
|| poifsDir.hasEntry("__substg1.0_0047001F")
|
// https://msdn.microsoft.com/en-us/library/cc433490(v=exchg.80).aspx
|
||||||
|| poifsDir.hasEntry("__substg1.0_0037001E")
|
"__substg1.0_1000001E", //PidTagBody
|
||||||
|| poifsDir.hasEntry("__substg1.0_0037001F"))
|
"__substg1.0_1000001F", //PidTagBody
|
||||||
{
|
"__substg1.0_0047001E", //PidTagMessageSubmissionId
|
||||||
|
"__substg1.0_0047001F", //PidTagMessageSubmissionId
|
||||||
|
"__substg1.0_0037001E", //PidTagSubject
|
||||||
|
"__substg1.0_0037001F", //PidTagSubject
|
||||||
|
};
|
||||||
|
for (String entryName : outlookEntryNames) {
|
||||||
|
if (poifsDir.hasEntry(entryName)) {
|
||||||
return new OutlookTextExtactor(poifsDir);
|
return new OutlookTextExtactor(poifsDir);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Iterator<Entry> entries = poifsDir.getEntries(); entries.hasNext();) {
|
for (String entryName : poifsDir.getEntryNames()) {
|
||||||
Entry entry = entries.next();
|
if (entryName.equals("Package")) {
|
||||||
|
|
||||||
if (entry.getName().equals("Package")) {
|
|
||||||
OPCPackage pkg = OPCPackage.open(poifsDir.createDocumentInputStream("Package"));
|
OPCPackage pkg = OPCPackage.open(poifsDir.createDocumentInputStream("Package"));
|
||||||
return createExtractor(pkg);
|
return createExtractor(pkg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue