--- /dev/null
+package org.simantics.simulation.export;\r
+\r
+import java.io.BufferedOutputStream;\r
+import java.io.File;\r
+import java.io.FileOutputStream;\r
+import java.io.IOException;\r
+import java.io.PrintStream;\r
+\r
+import org.simantics.history.HistoryException;\r
+import org.simantics.history.csv.CSVFormatter;\r
+\r
+public class CSVWriter extends CSVFormatter {\r
+ public File file; \r
+ \r
+ public void write() throws IOException, HistoryException {\r
+ FileOutputStream fos = null;\r
+ try {\r
+ fos = new FileOutputStream(file, true);\r
+ BufferedOutputStream bos = new BufferedOutputStream( fos );\r
+ PrintStream ps = new PrintStream( bos );\r
+ formulate2( null, ps );\r
+ bos.flush();\r
+ } finally {\r
+ if ( fos != null ) {\r
+ try {\r
+ fos.close();\r
+ } catch (IOException e) {\r
+ }\r
+ }\r
+ }\r
+ \r
+ }\r
+}\r