X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=inline;f=bundles%2Forg.simantics.fileimport%2Fsrc%2Forg%2Fsimantics%2Ffileimport%2Fscl%2FDropinsSCL.java;h=50fd584466bedd5849d950b9c778f80b16441fa3;hb=cb9643ae2fed519f02b4e95126836722d97105bc;hp=cad45187721a8caef5345cea807c426d4a9c9f1a;hpb=b809a171b6dfb81ed9ef9e84870dcbcbc5912f0e;p=simantics%2Fplatform.git
diff --git a/bundles/org.simantics.fileimport/src/org/simantics/fileimport/scl/DropinsSCL.java b/bundles/org.simantics.fileimport/src/org/simantics/fileimport/scl/DropinsSCL.java
index cad451877..50fd58446 100644
--- a/bundles/org.simantics.fileimport/src/org/simantics/fileimport/scl/DropinsSCL.java
+++ b/bundles/org.simantics.fileimport/src/org/simantics/fileimport/scl/DropinsSCL.java
@@ -1,81 +1,112 @@
-package org.simantics.fileimport.scl;
-
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Optional;
-
-import org.simantics.Simantics;
-import org.simantics.databoard.util.Base64;
-import org.simantics.db.ReadGraph;
-import org.simantics.db.Resource;
-import org.simantics.db.common.request.UniqueRead;
-import org.simantics.db.exception.DatabaseException;
-import org.simantics.db.service.SerialisationSupport;
-import org.simantics.fileimport.Activator;
-import org.simantics.fileimport.FileImportService;
-import org.simantics.fileimport.dropins.FileImportDropins;
-import org.simantics.layer0.Layer0;
-import org.simantics.utils.FileUtils;
-
-/**
- * SCL interface for Simantics File Import Functionality
- * See "Dropins/Core"
SCL module for more
- *
- * @author Jani Simomaa
- *
- */
-public class DropinsSCL {
-
- public static void watchDropinsFolder() {
- FileImportDropins.watchDropinsFolder();
- }
-
- public static void unwatchDropinsFolder() {
- FileImportDropins.unwatchDropinsFolder();
- }
-
- public static void uploadToDropinsBase64(String base64, String fileName) {
- // ensure that watcher is awake
- FileImportDropins.watchDropinsFolder();
- try {
- Path rootFolder = Activator.getDropinsFolder();
- byte[] bytes = Base64.decode(base64);
- FileUtils.writeFile(rootFolder.resolve(fileName).toFile(), bytes);
-
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- public static Map getUploadedFiles() throws DatabaseException {
- Map results = FileImportService.getPathsAndResources();
- Map result = Simantics.getSession().syncRequest(new UniqueRead