]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graphfile/src/org/simantics/graphfile/util/GraphFileUtil.java
Fall back to HasName if HasResourceName not available for GraphFile
[simantics/platform.git] / bundles / org.simantics.graphfile / src / org / simantics / graphfile / util / GraphFileUtil.java
index 76003e023d778a1a73826152e715190400ac31ea..fbfcc3a146e9c39a63853cec2faf3c6d52eaa29b 100644 (file)
@@ -76,7 +76,9 @@ public class GraphFileUtil {
        public static File toTempFile(ReadGraph graph, Resource res)throws DatabaseException {
 
                GraphFileResource gf = GraphFileResource.getInstance(graph);
-               String filename = graph.getRelatedValue(res, gf.HasResourceName);
+               String filename = graph.getPossibleRelatedValue(res, gf.HasResourceName);
+               if (filename == null)
+                   filename = graph.getRelatedValue(res, Layer0.getInstance(graph).HasName);
                
                int index = filename.lastIndexOf(".");
                String name = "";