X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=inline;f=bundles%2Forg.simantics.graph%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Frefactoring%2FFixExportedOntology.java;h=1c567b1e21d39294f00652a0e8467e33cf803044;hb=e19c37f84fd1ce2d946578f7c05f3e45444ba67a;hp=09931e604bf6fdddf9ab751f20e0f910090210c6;hpb=2a46c55805427cfb40ed0db7e33208bb5ffb3d7a;p=simantics%2Fplatform.git
diff --git a/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java b/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java
index 09931e604..1c567b1e2 100644
--- a/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java
+++ b/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java
@@ -1,51 +1,59 @@
-package org.simantics.graph.refactoring;
-
-import java.io.BufferedInputStream;
-import java.io.DataInput;
-import java.io.DataInputStream;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import org.simantics.databoard.binding.Binding;
-import org.simantics.databoard.binding.mutable.Variant;
-import org.simantics.databoard.container.DataContainer;
-import org.simantics.databoard.container.DataContainers;
-import org.simantics.graph.representation.TransferableGraph1;
-
-/**
- * @author Antti Villberg
- * @since 1.24.0
- */
-public class FixExportedOntology {
-
- static void convertExportedSharedOntologyIntoBundleOntology(Path input, Path output) throws Exception {
- System.out.format("Converting exported shared ontology%n\t" + input.toString() + "%nto bundle-compatible ontology%n\t" + output.toString());
- try (InputStream is = new BufferedInputStream(Files.newInputStream(input), 128*1024)) {
- DataInput dis = new DataInputStream(is);
- org.simantics.databoard.container.DataContainer container =
- DataContainers.readFile(dis);
- Binding binding = TransferableGraph1.BINDING;
- TransferableGraph1 graph = (TransferableGraph1)container.content.getValue(binding);
- GraphRefactoringUtils.fixOntologyExport(graph);
-
- DataContainers.writeFile(output.toFile(), new DataContainer(
- container.format, container.version,
- container.metadata, new Variant(TransferableGraph1.BINDING, graph)));
- }
- }
-
- public static void main(String[] args) throws Exception {
- if (args.length < 1) {
- System.out.println("Required arguments: [