Changeset 4780 for devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/IOUtil.java
- Timestamp:
- 07/18/11 10:56:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/common/IOUtil.java
r4344 r4780 1 1 package org.expressolivre.cte.common; 2 2 3 import java.io.BufferedWriter; 3 4 import java.io.File; 4 5 import java.io.FileReader; 6 import java.io.FileWriter; 5 7 import java.io.IOException; 6 8 import java.io.InputStream; … … 16 18 */ 17 19 public class IOUtil { 20 21 /** 22 * Open and write contents to a file. 23 * 24 * @param fileName 25 * the name of the file. 26 * @param contents 27 * contents to be written. 28 * @param append 29 * if <code>true</code> contents will be appended to previous 30 * contents of the file. If <code>false</code> a brand new file 31 * is created to write the contents. 32 * @throws IOException 33 * Thrown whenever a problem in the underlying file system 34 * happens. 35 */ 36 public static void writeFile(String fileName, String contents, 37 Boolean append) throws IOException { 38 BufferedWriter out = new BufferedWriter( 39 new FileWriter(fileName, append)); 40 out.write(contents); 41 out.close(); 42 } 18 43 19 44 /**
Note: See TracChangeset
for help on using the changeset viewer.