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
}\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