Java File Write fileWriter(String outfile, String contents, boolean append)

Here you can find the source of fileWriter(String outfile, String contents, boolean append)

Description

Synopsis [ ] String to file, with append to file true/false option

License

Open Source License

Declaration

public static void fileWriter(String outfile, String contents, boolean append) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    /***********************************************************************
        /*from  w  ww. j  av  a 2 s.c o  m*/
     Synopsis    [  ]
        
     String to file, with append to file true/false option
        
     ***********************************************************************/
    public static void fileWriter(String outfile, String contents, boolean append) {
        try {
            BufferedWriter bw = new BufferedWriter(new FileWriter(new File(outfile), append)); //append
            bw.write(contents);
            bw.close();
        } catch (Exception e) {
        }
    }
}

Related

  1. fileWrite(String filePath, String fileName, String content)
  2. fileWrite(String path, int format, String content, Object bytesObj)
  3. fileWrite(String[] text, File file)
  4. fileWriteOut(InputStream in, String outPath)
  5. fileWriter(int startpt, int letter)
  6. fileWriteString(String filePath, String strWrite, boolean append)