aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/extractor
diff options
context:
space:
mode:
authorMaxim Valyanskiy <maxcom@apache.org>2010-01-14 09:22:39 +0000
committerMaxim Valyanskiy <maxcom@apache.org>2010-01-14 09:22:39 +0000
commit2956525db2196e355196e02f85fae24e3bd50f2a (patch)
treebbb1f87c42afbbb846fb810886620eb4316f02b3 /src/ooxml/java/org/apache/poi/extractor
parent4e3c970131b9ac56802c2a518e1b7dd9cfe39a86 (diff)
downloadpoi-2956525db2196e355196e02f85fae24e3bd50f2a.tar.gz
poi-2956525db2196e355196e02f85fae24e3bd50f2a.zip
revert previous commit
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@899129 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/extractor')
-rw-r--r--src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java b/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java
index 394313cdca..24a2632be6 100644
--- a/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java
+++ b/src/ooxml/java/org/apache/poi/extractor/ExtractorFactory.java
@@ -16,7 +16,13 @@
==================================================================== */
package org.apache.poi.extractor;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PushbackInputStream;
import java.util.ArrayList;
import java.util.Iterator;
@@ -24,8 +30,6 @@ import org.apache.poi.POIOLE2TextExtractor;
import org.apache.poi.POITextExtractor;
import org.apache.poi.POIXMLDocument;
import org.apache.poi.POIXMLTextExtractor;
-import org.apache.poi.util.TempFile;
-import org.apache.poi.util.IOUtils;
import org.apache.poi.hdgf.extractor.VisioTextExtractor;
import org.apache.poi.hpbf.extractor.PublisherTextExtractor;
import org.apache.poi.hslf.extractor.PowerPointExtractor;
@@ -83,22 +87,9 @@ public class ExtractorFactory {
if(POIFSFileSystem.hasPOIFSHeader(inp)) {
return createExtractor(new POIFSFileSystem(inp));
}
-
if(POIXMLDocument.hasOOXMLHeader(inp)) {
- File file = TempFile.createTempFile("poi-ooxml-", ".tmp");
-
- try {
- FileOutputStream out = new FileOutputStream(file);
- IOUtils.copy(inp, out);
- out.close();
-
- return createExtractor(OPCPackage.open(file.getPath()));
- } finally {
- if (file.exists()) {
- file.delete();
- }
- }
- }
+ return createExtractor(OPCPackage.open(inp));
+ }
throw new IllegalArgumentException("Your InputStream was neither an OLE2 stream, nor an OOXML stream");
}