]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil.core/src/org/simantics/fmil/core/FMIL.java
Add atomic counter for instanceName and update README, fix loadFMU
[simantics/fmil.git] / org.simantics.fmil.core / src / org / simantics / fmil / core / FMIL.java
index f4c7ca4f2fbbf7d044be10c09a2b4f896b31fe0b..1f1e098d7eade1d37c3edd6a2c5dec8c13acff83 100644 (file)
@@ -184,6 +184,11 @@ public class FMIL {
     private boolean fmuLoaded = false;
     public void loadFMUFile(String path) throws FMILException {
 
+        if (!Files.exists(Paths.get(path)))
+            throw new FMILException("File " + path + " does not exist");
+        if (!Files.isRegularFile(Paths.get(path)))
+            throw new FMILException("Path " + path + " is not a file");
+
         synchronized(syncObject) {
 
             if(fmuN % 2 == 0) {
@@ -232,7 +237,7 @@ public class FMIL {
         }
     }
 
-    private native int loadFMUFile_(String path, String toDir);
+    private native int loadFMUFile_(String path, String toDir) throws FMILException;
 
     /**
      * Set a step length for simulation