| | |
| | | import java.io.FileWriter; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.io.Reader; |
| | | import java.nio.charset.Charset; |
| | | import java.security.Principal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | try { |
| | | File targetFile = new File(getTargetDir(relPath), fileName); |
| | | |
| | | //reader = new InputStreamReader(new FileInputStream(targetFile), "UTF8"); |
| | | reader = new FileReader(targetFile); |
| | | reader = new InputStreamReader(new FileInputStream(targetFile), "UTF8"); |
| | | //reader = new FileReader(targetFile); |
| | | StringBuffer buf = new StringBuffer(); |
| | | char[] readBuffer = new char[1024]; |
| | | int charsRead = reader.read(readBuffer); |
| | |
| | | FileRef savedFile = null; |
| | | try { |
| | | targetFile.createNewFile(); |
| | | FileWriter w = new FileWriter(targetFile); |
| | | FileWriter w = new FileWriter(targetFile, Charset.forName("UTF-8")); |
| | | //w.write(StringEscapeUtils.unescapeHtml(contents)); |
| | | w.write(contents); |
| | | w.flush(); |