]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.fileimport/src/org/simantics/fileimport/Activator.java
Some fixes for FileImportService to throw exceptions forward
[simantics/platform.git] / bundles / org.simantics.fileimport / src / org / simantics / fileimport / Activator.java
index 9c0f77072c2cdbecb0071f3ac8f9022e36837902..2918674518aade7bed60e1780686ab5c8d18efea 100644 (file)
@@ -13,8 +13,9 @@ import org.simantics.fileimport.dropins.FileImportDropins;
 
 public class Activator implements BundleActivator {
 
-       private static BundleContext context;
+    private static BundleContext context;
        
+    private static Path modelsFolder = null;
        private static Path dropinsFolder = null;
 
        static BundleContext getContext() {
@@ -48,4 +49,14 @@ public class Activator implements BundleActivator {
            return dropinsFolder;
        }
 
+    public static Path getModelsFolder() throws IOException {
+        if (modelsFolder == null) {
+            IPath state = Platform.getStateLocation(context.getBundle());
+            modelsFolder = Paths.get(state.append("models").toOSString());
+            if (!Files.exists(modelsFolder))
+                Files.createDirectories(modelsFolder);
+        }
+        return modelsFolder;
+    }
+
 }