import java.io.IOException;
import java.io.InputStream;
+import java.util.List;
import org.apache.poi.POIXMLDocument;
+import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
+import org.apache.poi.openxml4j.opc.OPCPackage;
+import org.apache.poi.openxml4j.opc.PackageAccess;
+import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.junit.Ignore;
+import org.junit.Test;
public final class POIXMLDocumentHandler {
protected void handlePOIXMLDocument(POIXMLDocument doc) throws Exception {
}
return false;
}
+
+ // a test-case to test this locally without executing the full TestAllFiles
+ @Ignore("POIXMLDocument cannot handle this Visio file currently...")
+ @Test
+ public void test() throws Exception {
+ OPCPackage pkg = OPCPackage.open("test-data/diagram/test.vsdx", PackageAccess.READ);
+ try {
+ handlePOIXMLDocument(new TestPOIXMLDocument(pkg));
+ } finally {
+ pkg.close();
+ }
+ }
+
+ private final static class TestPOIXMLDocument extends POIXMLDocument {
+ public TestPOIXMLDocument(OPCPackage pkg) {
+ super(pkg);
+ }
+
+ public List<PackagePart> getAllEmbedds() throws OpenXML4JException {
+ return null;
+ }
+ }
}