List of utility methods to do Text File Write
void | write(File file, List write try { BufferedWriter wtr = new BufferedWriter(new FileWriter(file)); for (String c : content) { wtr.write(c); wtr.flush(); wtr.close(); } catch (FileNotFoundException e) { ... |
void | write(File file, String content) write try { BufferedWriter wtr = new BufferedWriter(new FileWriter(file)); wtr.write(content); wtr.flush(); wtr.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { ... |
void | write(File file, String s) write if (file.getParent() != null) { mkdirs(file.getParent()); BufferedWriter bw = new BufferedWriter(new FileWriter(file)); bw.flush(); bw.write(s); bw.flush(); bw.close(); ... |
void | write(File file, String s, boolean lazy) write write(file, s, lazy, false); |
void | write(File file, String s, boolean lazy, boolean append) write if (file.getParent() != null) { mkdirs(file.getParent()); if (lazy && file.exists()) { String content = read(file); if (content.equals(s)) { return; BufferedWriter bw = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(file, append), StringPool.UTF8)); bw.write(s); bw.close(); |
void | write(String fileName, String s) write write(new File(fileName), s);
|
void | write(String pathName, String fileName, String s) write write(new File(pathName, fileName), s);
|
void | write2File(Set write File File file = new File(path); try { file.createNewFile(); BufferedWriter bw = new BufferedWriter(new FileWriter(file)); for (String str : set) { bw.write(str); bw.newLine(); bw.flush(); bw.close(); } catch (IOException e) { e.printStackTrace(); |
void | writeFile(File f, String content) write string s into file f final FileWriter fw = new FileWriter(f); fw.append(content); fw.close(); |
void | writeFile(File file, String content) Reads some bytes from the file. if (!file.exists()) { file.getParentFile().mkdirs(); FileWriter out = null; try { out = new FileWriter(file); out.write(content); } finally { ... |