]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/TGRepresentation.java
Delete temporary files after use in delayed writes and model TG export
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / TGRepresentation.java
index 0f9ffa0a73730314f7ba6d56a655f507d28d9b0c..ed7ae5193837190debb03efdc7c6244a1898d7fc 100644 (file)
@@ -1,5 +1,6 @@
 package org.simantics.db.layer0.util;
 
+import java.io.IOException;
 import java.util.Arrays;
 import java.util.Map;
 
@@ -49,9 +50,11 @@ public class TGRepresentation implements Representation {
                        configuration.exclusionFunction = TGRepresentationUtils.computeExclusionFunction(graph, resources, hints);
                }
                
-               ModelTransferableGraphSource source = graph.syncRequest(new ModelTransferableGraphSourceRequest(configuration));
-               return TransferableGraphs.create(graph, source);
-               
+               try (ModelTransferableGraphSource source = graph.syncRequest(new ModelTransferableGraphSourceRequest(configuration))) {
+                       return TransferableGraphs.create(graph, source);
+               } catch (IOException e) {
+                       throw new DatabaseException(e);
+               }
        }
        
        @SuppressWarnings("unchecked")