- Timestamp:
- 05/17/11 15:40:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/LogPreprocessor.java
r1 r44 3 3 import java.io.File; 4 4 import java.io.FileNotFoundException; 5 import java.io.FileOutputStream; 5 6 import java.io.FileReader; 6 import java.io.FileWriter;7 7 import java.io.IOException; 8 import java.io.OutputStreamWriter; 8 9 9 10 import org.apache.commons.codec.binary.Base64; … … 28 29 29 30 public void convertToXml(String source, String target) throws IOException, FileNotFoundException { 30 FileWriter targetFile = new FileWriter(target);31 targetFile.write("<?xml version=\"1.0\" encoding=\"UTF- 8\"?>" + StringTools.ENDLINE);31 OutputStreamWriter targetFile = new OutputStreamWriter(new FileOutputStream(target), "UTF-16"); 32 targetFile.write("<?xml version=\"1.0\" encoding=\"UTF-16\"?>" + StringTools.ENDLINE); 32 33 targetFile.write("<log>" + StringTools.ENDLINE); 33 34 processFile(source, targetFile); … … 41 42 42 43 public void convertDirToXml(String path, String target) throws IOException, FileNotFoundException { 43 FileWriter targetFile = new FileWriter(target);44 targetFile.write("<?xml version=\"1.0\" encoding=\"UTF- 8\"?>" + StringTools.ENDLINE);44 OutputStreamWriter targetFile = new OutputStreamWriter(new FileOutputStream(target), "UTF-16"); 45 targetFile.write("<?xml version=\"1.0\" encoding=\"UTF-16\"?>" + StringTools.ENDLINE); 45 46 targetFile.write("<log>" + StringTools.ENDLINE); 46 47 File folder = new File(path); … … 62 63 } 63 64 64 private void processFile(String source, FileWriter targetFile)65 private void processFile(String source, OutputStreamWriter targetFile) 65 66 throws FileNotFoundException, IOException { 66 67 File f = new File(source);
Note: See TracChangeset
for help on using the changeset viewer.