View | Details | Raw Unified | Return to bug 45018
Collapse All | Expand All

(-)src/ooxml/java/org/apache/poi/POIXMLDocument.java (+19 lines)
Lines 19-24 Link Here
19
import java.io.IOException;
19
import java.io.IOException;
20
import java.io.InputStream;
20
import java.io.InputStream;
21
import java.io.PushbackInputStream;
21
import java.io.PushbackInputStream;
22
import java.util.LinkedList;
23
import java.util.List;
22
24
23
import org.apache.poi.poifs.common.POIFSConstants;
25
import org.apache.poi.poifs.common.POIFSConstants;
24
import org.apache.poi.util.IOUtils;
26
import org.apache.poi.util.IOUtils;
Lines 39-44 Link Here
39
    
41
    
40
    public static final String EXTENDED_PROPERTIES_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
42
    public static final String EXTENDED_PROPERTIES_REL_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
41
    
43
    
44
    public static final String OLE_OBJECT_REL_TYPE="http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
45
    
42
    /** The OPC Package */
46
    /** The OPC Package */
43
    private Package pkg;
47
    private Package pkg;
44
48
Lines 50-55 Link Here
50
     */
54
     */
51
    private POIXMLProperties properties;
55
    private POIXMLProperties properties;
52
    
56
    
57
    private List<PackagePart> embedds;
53
    
58
    
54
    protected POIXMLDocument() {}
59
    protected POIXMLDocument() {}
55
    
60
    
Lines 62-67 Link Here
62
	    
67
	    
63
	        // Get core part
68
	        // Get core part
64
	        this.corePart = this.pkg.getPart(coreDocRelationship);
69
	        this.corePart = this.pkg.getPart(coreDocRelationship);
70
	        
71
	        this.embedds = new LinkedList<PackagePart>();
72
	        for(PackageRelationship rel : corePart.getRelationshipsByType(OLE_OBJECT_REL_TYPE))
73
	        {
74
	            embedds.add(getTargetPart(rel));
75
	        }
65
        } catch (OpenXML4JException e) {
76
        } catch (OpenXML4JException e) {
66
            throw new IOException(e.toString());
77
            throw new IOException(e.toString());
67
    	}
78
    	}
Lines 190-193 Link Here
190
		}
201
		}
191
		return properties;
202
		return properties;
192
	}
203
	}
204
	
205
    /**
206
     * Get the document's embedded files.
207
     */
208
    public List<PackagePart> getAllEmbedds() throws OpenXML4JException
209
    {
210
        return embedds;
211
    }
193
}
212
}
(-)src/ooxml/java/org/apache/poi/POIXMLTextExtractor.java (+7 lines)
Lines 47-50 Link Here
47
	public ExtendedProperties getExtendedProperties() throws IOException, OpenXML4JException, XmlException {
47
	public ExtendedProperties getExtendedProperties() throws IOException, OpenXML4JException, XmlException {
48
		return document.getProperties().getExtendedProperties();
48
		return document.getProperties().getExtendedProperties();
49
	}
49
	}
50
51
	/**
52
	 * Returns opened document 
53
	 */
54
	public POIXMLDocument getDocument(){
55
	    return document;
56
	}
50
}
57
}
(-)src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java (-1 / +1 lines)
Lines 58-64 Link Here
58
	public static void main(String[] args) throws Exception {
58
	public static void main(String[] args) throws Exception {
59
		if(args.length < 1) {
59
		if(args.length < 1) {
60
			System.err.println("Use:");
60
			System.err.println("Use:");
61
			System.err.println("  HXFWordExtractor <filename.xlsx>");
61
			System.err.println("  HXFWordExtractor <filename.docx>");
62
			System.exit(1);
62
			System.exit(1);
63
		}
63
		}
64
		POIXMLTextExtractor extractor = 
64
		POIXMLTextExtractor extractor = 

Return to bug 45018