X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.fileimport%2Fsrc%2Forg%2Fsimantics%2Ffileimport%2FSimanticsResourceFileImport.java;h=70439ef1db950a3861a2c7452a26d42f936882b5;hp=2836b670e5f0e5b5198b2cce95e01d97e8d39a07;hb=b809a171b6dfb81ed9ef9e84870dcbcbc5912f0e;hpb=96bb7ef9cbe42d82eb58306d8f9b62392cc29ba8 diff --git a/bundles/org.simantics.fileimport/src/org/simantics/fileimport/SimanticsResourceFileImport.java b/bundles/org.simantics.fileimport/src/org/simantics/fileimport/SimanticsResourceFileImport.java index 2836b670e..70439ef1d 100644 --- a/bundles/org.simantics.fileimport/src/org/simantics/fileimport/SimanticsResourceFileImport.java +++ b/bundles/org.simantics.fileimport/src/org/simantics/fileimport/SimanticsResourceFileImport.java @@ -19,12 +19,19 @@ import org.simantics.db.request.Read; import org.simantics.db.service.SerialisationSupport; import org.simantics.layer0.Layer0; +/** + * Most of the implementations should extend this class which handles the storing of + * the identifier of the imported entity and the removing of the entity + * + * @author Jani Simomaa + * + */ public abstract class SimanticsResourceFileImport implements IGenericFileImport { @Override final public Optional perform(Path file) throws Exception { - Path dropins = Activator.getDropinsFolder(); + Path dropins = Activator.getDropinsFolder(); Path parts = dropins.relativize(file); Resource parent = resolveParent(null, parts); if (parent == null) @@ -37,7 +44,15 @@ public abstract class SimanticsResourceFileImport implements IGenericFileImport } } - public abstract Optional perform(Resource parent, Path file); + /** + * Performs the import for the given file + * + * @param parent Resource parent of the imported entity in Simantics database + * @param file Path file location of file + * @return Optional Resource of the imported entity in Simantics database + * @throws Exception + */ + public abstract Optional perform(Resource parent, Path file) throws Exception; @Override public void remove(String resourceId) throws Exception {