]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.fileimport/src/org/simantics/fileimport/SimanticsResourceFileImport.java
Sync git svn branch with SVN repository r33189.
[simantics/platform.git] / bundles / org.simantics.fileimport / src / org / simantics / fileimport / SimanticsResourceFileImport.java
index 2836b670e5f0e5b5198b2cce95e01d97e8d39a07..70439ef1db950a3861a2c7452a26d42f936882b5 100644 (file)
@@ -19,12 +19,19 @@ import org.simantics.db.request.Read;
 import org.simantics.db.service.SerialisationSupport;\r
 import org.simantics.layer0.Layer0;\r
 \r
+/**\r
+ * Most of the implementations should extend this class which handles the storing of\r
+ * the identifier of the imported entity and the removing of the entity\r
+ * \r
+ * @author Jani Simomaa\r
+ *\r
+ */\r
 public abstract class SimanticsResourceFileImport implements IGenericFileImport {\r
 \r
     @Override\r
     final public Optional<String> perform(Path file) throws Exception {\r
         \r
-        Path dropins = Activator.getDropinsFolder();    \r
+        Path dropins = Activator.getDropinsFolder();\r
         Path parts = dropins.relativize(file);\r
         Resource parent = resolveParent(null, parts);\r
         if (parent == null)\r
@@ -37,7 +44,15 @@ public abstract class SimanticsResourceFileImport implements IGenericFileImport
         }\r
     }\r
     \r
-    public abstract Optional<Resource> perform(Resource parent, Path file);\r
+    /**\r
+     * Performs the import for the given file\r
+     * \r
+     * @param parent Resource parent of the imported entity in Simantics database\r
+     * @param file Path file location of file\r
+     * @return Optional Resource of the imported entity in Simantics database\r
+     * @throws Exception\r
+     */\r
+    public abstract Optional<Resource> perform(Resource parent, Path file) throws Exception;\r
     \r
     @Override\r
     public void remove(String resourceId) throws Exception {\r