dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20691
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9590: Minor
------------------------------------------------------------
revno: 9590
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-01-23 14:40:54 +0100
message:
Minor
modified:
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/StreamUtils.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/StreamUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/StreamUtils.java 2012-10-01 10:50:34 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/StreamUtils.java 2013-01-23 13:40:54 +0000
@@ -35,6 +35,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -208,6 +209,24 @@
}
/**
+ * Creates a FileWriter.
+ *
+ * @param file the name of the file.
+ * @return a FileWriter.
+ */
+ public static Writer getFileWriter( String file )
+ {
+ try
+ {
+ return new BufferedWriter( new FileWriter( file ) );
+ }
+ catch ( IOException ex )
+ {
+ throw new RuntimeException( ex );
+ }
+ }
+
+ /**
* Returns the content of the File as a String.
*
* @param file the File.