]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java
Minor fix and optimization for exporting TG and Pgraph with sharedlib
[simantics/platform.git] / bundles / org.simantics.graph / src / org / simantics / graph / refactoring / FixExportedOntology.java
index 91d85ecf9732f9c5395b1094c2731a0d468e7d4c..90738f70d1c8243366659ff2901ce315247eafc9 100644 (file)
@@ -50,12 +50,12 @@ public class FixExportedOntology {
            convertExportedSharedOntologyIntoBundleOntology(input, output);
        }
        
            convertExportedSharedOntologyIntoBundleOntology(input, output);
        }
        
-       public static void createPGraph(Path input) throws Exception {
+       public static void createTGAndPGraph(Path input) throws Exception {
         Path output1 = input.getParent().resolve("graph.tg");
         TransferableGraph1 tg = convertExportedSharedOntologyIntoBundleOntology(input, output1);
         String listing = PrettyPrintTG.print(tg, false);
         String newName = input.getFileName().toString();
         Path output1 = input.getParent().resolve("graph.tg");
         TransferableGraph1 tg = convertExportedSharedOntologyIntoBundleOntology(input, output1);
         String listing = PrettyPrintTG.print(tg, false);
         String newName = input.getFileName().toString();
-        if (newName.contains("\\."))
+        if (newName.contains("."))
             newName = newName.split("\\.")[0];
         Path output2 = input.getParent().resolve(newName + ".pgraph");
         Files.write(output2, listing.getBytes(),StandardOpenOption.CREATE);
             newName = newName.split("\\.")[0];
         Path output2 = input.getParent().resolve(newName + ".pgraph");
         Files.write(output2, listing.getBytes(),StandardOpenOption.CREATE);
@@ -66,7 +66,7 @@ public class FixExportedOntology {
                        System.out.println("Required arguments: <input .sharedLibrary file> [<output .tg file>]");
                } else if (args.length == 1) {
                        Path input = Paths.get(args[0]);
                        System.out.println("Required arguments: <input .sharedLibrary file> [<output .tg file>]");
                } else if (args.length == 1) {
                        Path input = Paths.get(args[0]);
-                       createPGraph(input);
+                       createTGAndPGraph(input);
                } else {
                        convertExportedSharedOntologyIntoBundleOntology(Paths.get(args[0]), Paths.get(args[1]));
                }
                } else {
                        convertExportedSharedOntologyIntoBundleOntology(Paths.get(args[0]), Paths.get(args[1]));
                }