The list of methods to do PrintWriter Write are organized into topic(s).
void
save(String fileName, List list) save
PrintWriter pw = new PrintWriter(new FileOutputStream(fileName));
for (String title : list)
pw.println(title);
pw.close();
void
save(String s, File file) save
try {
PrintWriter out = new PrintWriter(file);
out.println(s);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
void
saveConvert(final String text, final int escapeMode, final PrintWriter writer) Performs the necessary conversion of an java string into a property escaped string.
if (text == null) {
return;
final char[] string = text.toCharArray();
final char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
for (int x = 0; x < string.length; x++) {
final char aChar = string[x];
switch (aChar) {
...
void
saveFile(File f, String text) Given a file to write to, and data to write to it, it will write the data.
try (PrintWriter out = new PrintWriter(f)) {
out.println(text);
} catch (IOException ioex) {
System.out.println("Could not write to file " + f.toString());
void
saveFile(String fileName, String data) save File
PrintWriter writer = null;
try {
writer = new PrintWriter(fileName, "UTF-8");
writer.print(data);
} catch (FileNotFoundException | UnsupportedEncodingException e) {
e.printStackTrace();
} finally {
if (writer != null)
...
void
saveFile(String path, String text) save File
PrintWriter out;
try {
out = new PrintWriter(path);
out.print(text);
out.close();
} catch (FileNotFoundException e) {
throw e;