@Test public void testXMind2020() throws Exception { final MindMap parsed = INSTANCE.parseZipFile(findZip("xmind2020.xmind")); Assertions.assertEquals("Central Topic", parsed.getRoot().getText()); Assertions.assertEquals(4, parsed.getRoot().getChildren().size()); }
@Nonnull MindMap parseZipFile(@Nonnull final ZipFile zipFile) throws Exception { InputStream contentStream = Utils.findInputStreamForResource(zipFile, "content.json"); MindMap result; if (contentStream == null) { final XMindStyles styles = new XMindStyles(zipFile); contentStream = Utils.findInputStreamForResource(zipFile, "content.xml"); if (contentStream == null) { throw makeWrongFormatException(); } else { result = convertXmlContent(styles, zipFile, contentStream); } } else { result = convertJsonContent(zipFile, contentStream); } return result; }
XMind2MindMapImporter extends AbstractImporter { @Nonnull MindMap parseZipFile(@Nonnull final ZipFile zipFile) throws Exception { InputStream contentStream = Utils.findInputStreamForResource(zipFile, "content.json"); MindMap result; if (contentStream == null) { final XMindStyles styles = new XMindStyles(zipFile); contentStream = Utils.findInputStreamForResource(zipFile, "content.xml"); if (contentStream == null) { throw makeWrongFormatException(); } else { result = convertXmlContent(styles, zipFile, contentStream); } } else { result = convertJsonContent(zipFile, contentStream); } return result; } }
XMind2MindMapImporter extends AbstractImporter { @Nonnull MindMap parseZipFile(@Nonnull final ZipFile zipFile) throws Exception { InputStream contentStream = Utils.findInputStreamForResource(zipFile, "content.json"); MindMap result; if (contentStream == null) { final XMindStyles styles = new XMindStyles(zipFile); contentStream = Utils.findInputStreamForResource(zipFile, "content.xml"); if (contentStream == null) { throw makeWrongFormatException(); } else { result = convertXmlContent(styles, zipFile, contentStream); } } else { result = convertJsonContent(zipFile, contentStream); } return result; }  }
XMind2MindMapImporter extends AbstractImporter { @Nonnull MindMap parseZipFile(@Nonnull final ZipFile zipFile) throws Exception { InputStream contentStream = Utils.findInputStreamForResource(zipFile, "content.json"); MindMap result; if (contentStream == null) { final XMindStyles styles = new XMindStyles(zipFile); contentStream = Utils.findInputStreamForResource(zipFile, "content.xml"); if (contentStream == null) { throw makeWrongFormatException(); } else { result = convertXmlContent(styles, zipFile, contentStream); } } else { result = convertJsonContent(zipFile, contentStream); } return result; }  @Override @Nullable MindMap doImport(@Nonnull final PluginContext context); @Override @Nullable String getMnemonic(); @Override @Nonnull String getName(@Nonnull final PluginContext context); @Override @Nonnull String getReference(@Nonnull final PluginContext context); @Override @Nonnull Icon getIcon(@Nonnull final PluginContext context); @Override int getOrder(); }
XMind2MindMapImporter extends AbstractImporter { @Nonnull MindMap parseZipFile(@Nonnull final ZipFile zipFile) throws Exception { InputStream contentStream = Utils.findInputStreamForResource(zipFile, "content.json"); MindMap result; if (contentStream == null) { final XMindStyles styles = new XMindStyles(zipFile); contentStream = Utils.findInputStreamForResource(zipFile, "content.xml"); if (contentStream == null) { throw makeWrongFormatException(); } else { result = convertXmlContent(styles, zipFile, contentStream); } } else { result = convertJsonContent(zipFile, contentStream); } return result; }  @Override @Nullable MindMap doImport(@Nonnull final PluginContext context); @Override @Nullable String getMnemonic(); @Override @Nonnull String getName(@Nonnull final PluginContext context); @Override @Nonnull String getReference(@Nonnull final PluginContext context); @Override @Nonnull Icon getIcon(@Nonnull final PluginContext context); @Override int getOrder();  }