Previously model imports could fail if they were small and contained one
or more shared libraries imported at the same time because the imports
could be done within the same second which triggered the folder name
overlap.
refs #7603
Change-Id: I0f559f2fe2e7bdb1a8852e7cd7a74cecd7bb6055
import org.simantics.db.WriteOnlyGraph;
import org.simantics.db.common.request.WriteResultRequest;
import org.simantics.db.common.utils.Logger;
import org.simantics.db.WriteOnlyGraph;
import org.simantics.db.common.request.WriteResultRequest;
import org.simantics.db.common.utils.Logger;
+import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.AssumptionException;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;
import org.simantics.db.exception.AssumptionException;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor;
Resource indexRoot = graph.newResource();
String indexRootName = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date());
Resource indexRoot = graph.newResource();
String indexRootName = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date());
+ indexRootName = NameUtils.findFreshName(graph, indexRootName, temp, L0.ConsistsOf, "%s-%d");
graph.claim(indexRoot, L0.InstanceOf, L0.IndexRoot);
graph.addLiteral(indexRoot, L0.HasName, L0.String, indexRootName, Bindings.STRING);
graph.claim(temp, L0.ConsistsOf, indexRoot);
graph.claim(indexRoot, L0.InstanceOf, L0.IndexRoot);
graph.addLiteral(indexRoot, L0.HasName, L0.String, indexRootName, Bindings.STRING);
graph.claim(temp, L0.ConsistsOf, indexRoot);