X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.fileimport%2Fsrc%2Forg%2Fsimantics%2Ffileimport%2FSimanticsResourceFileImport.java;h=67ff51dab9c029ae9ef7e1222bf83968058d220f;hb=HEAD;hp=4d2bcbe69105ff9a402931446718ef5e70a4c7b8;hpb=0d82e7808541ed486f6027a28038d44d2d93711a;p=simantics%2Fplatform.git 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 4d2bcbe69..67ff51dab 100644 --- a/bundles/org.simantics.fileimport/src/org/simantics/fileimport/SimanticsResourceFileImport.java +++ b/bundles/org.simantics.fileimport/src/org/simantics/fileimport/SimanticsResourceFileImport.java @@ -29,7 +29,7 @@ import org.simantics.layer0.Layer0; public abstract class SimanticsResourceFileImport implements IGenericFileImport { @Override - final public Optional perform(Path file) throws Exception { + final public Optional performWithDefaultParent(Path file) throws Exception { Path dropins = Activator.getDropinsFolder(); @@ -40,9 +40,13 @@ public abstract class SimanticsResourceFileImport implements IGenericFileImport 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 imported = perform(parent, file); if (imported.isPresent()) { return Optional.of(serialize(imported.get())); @@ -128,7 +132,5 @@ public abstract class SimanticsResourceFileImport implements IGenericFileImport return null; } } - - public abstract Resource defaultParentResource(); }