public abstract class SimanticsResourceFileImport implements IGenericFileImport {
@Override
- final public Optional<String> perform(Path file) throws Exception {
+ final public Optional<String> performWithDefaultParent(Path file) throws Exception {
Path dropins = Activator.getDropinsFolder();
parts = file.getFileName();
}
- Resource parent = resolveParent(null, parts);
+ Resource parent = defaultParentResource();
+ if(parent == null)
+ parent = resolveParent(null, parts);
+
if (parent == null)
return Optional.empty();
+
Optional<Resource> imported = perform(parent, file);
if (imported.isPresent()) {
return Optional.of(serialize(imported.get()));
* @return Optional Resource of the imported entity in Simantics database
* @throws Exception
*/
- public abstract Optional<Resource> perform(Resource parent, Path file) throws Exception;
@Override
public void remove(String resourceId) throws Exception {