@@ -0,0 +1,1256 @@
+/*%0A * To change this license header, choose License Headers in Project Properties.%0A * To change this template file, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage referencelibrary;%0A%0Aimport java.io.FileNotFoundException;%0Aimport java.io.PrintWriter;%0Aimport java.io.UnsupportedEncodingException;%0A%0A/**%0A * An utility class for writing a%0A *%0A * @author rimi%0A */%0Apublic class FileWriter %7B%0A%0A    /**%0A     * Creates a file or overwrites existing file with given content%0A     *%0A     * @param fileName name of the file to write to%0A     * @param content content of the file%0A     */%0A    static void Write(String fileName, String content) %7B%0A        PrintWriter writer = getWriter(fileName);%0A        writer.println(content);%0A        writer.close();%0A    %7D%0A%0A    /**%0A     * Gets a writer to be used to write to the given filename.%0A     *%0A     * @param fileName name of the file to write to%0A     * @return%0A     */%0A    protected static PrintWriter getWriter(String fileName) %7B%0A        try %7B%0A            return new PrintWriter(fileName, %22UTF-8%22);%0A        %7D catch (FileNotFoundException %7C UnsupportedEncodingException ex) %7B%0A            System.out.println(%22Could not open file to write to: %22 + ex.getMessage());%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

Add generic file writer