tika-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1221115 - /tika/trunk/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/ooxml/AbstractOOXMLExtractor.java
Date Tue, 20 Dec 2011 06:22:11 GMT
Author: nick
Date: Tue Dec 20 06:22:10 2011
New Revision: 1221115

URL: http://svn.apache.org/viewvc?rev=1221115&view=rev
Log:
TIKA-705 / TIKA-757 - Simplify the OOXML related parts code, following POI upgrade

Modified:
    tika/trunk/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/ooxml/AbstractOOXMLExtractor.java

Modified: tika/trunk/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/ooxml/AbstractOOXMLExtractor.java
URL: http://svn.apache.org/viewvc/tika/trunk/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/ooxml/AbstractOOXMLExtractor.java?rev=1221115&r1=1221114&r2=1221115&view=diff
==============================================================================
--- tika/trunk/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/ooxml/AbstractOOXMLExtractor.java
(original)
+++ tika/trunk/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/ooxml/AbstractOOXMLExtractor.java
Tue Dec 20 06:22:10 2011
@@ -18,8 +18,6 @@ package org.apache.tika.parser.microsoft
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.List;
 
 import org.apache.poi.POIXMLDocument;
@@ -27,7 +25,6 @@ import org.apache.poi.POIXMLTextExtracto
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.opc.PackagePart;
 import org.apache.poi.openxml4j.opc.PackageRelationship;
-import org.apache.poi.openxml4j.opc.PackagingURIHelper;
 import org.apache.poi.openxml4j.opc.TargetMode;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
 import org.apache.poi.poifs.filesystem.Ole10Native;
@@ -121,21 +118,7 @@ public abstract class AbstractOOXMLExtra
             for (PackagePart source : getMainDocumentParts()) {
                 for (PackageRelationship rel : source.getRelationships()) {
                     if (rel.getTargetMode() == TargetMode.INTERNAL) {
-                        // TODO Simply this when on POI 3.8 beta 5
-                        URI uri = rel.getTargetURI();
-                        if(uri.getFragment() != null) {
-                           // TODO Workaround for TIKA-705 needed until 3.8 beta 5
-                           try {
-                              String u = uri.toString();
-                              uri = new URI(u.substring(0, u.indexOf('#')));
-                           } catch(URISyntaxException e) {
-                              throw new TikaException("Broken OOXML file", e);
-                           }
-                        }
-                        PackagePart target = rel.getPackage().getPart(
-                                PackagingURIHelper.createPartName(uri));
-                        // TODO Simpler version in POI 3.8 beta 5
-                        // PackagePart target = source.getRelatedPart(rel);
+                        PackagePart target = source.getRelatedPart(rel);
 
                         String type = rel.getRelationshipType();
                         if (RELATION_OLE_OBJECT.equals(type)



Mime
View raw message