code: public static void writeToFile(String pFileName, String pContents, boolean pAppend)
       throws IOException{
           FileWriter writer = null;
           writer = new FileWriter(pFileName, pAppend);
           writer.write(pContents);
           writer.flush();
           writer.close();
  
      }
docs: Method that writes the file contents
  @param pFileName
  @param pContents
  @param pAppend