Here you can find the source of writeEndStringInFile(Path path, String s)
public static boolean writeEndStringInFile(Path path, String s)
//package com.java2s; //License from project: Open Source License import java.io.FileWriter; import java.io.IOException; import java.nio.file.Path; public class Main { public static boolean writeEndStringInFile(Path path, String s) { FileWriter writer;/*from w w w .j a v a 2 s . com*/ try { writer = new FileWriter(path.toFile(), true); writer.write(s + "\n"); writer.close(); return true; } catch (IOException e) { e.printStackTrace(); return false; } } }