Java BufferedWriter Write writefile(String m, String path)

Here you can find the source of writefile(String m, String path)

Description

writefile

License

Open Source License

Declaration

public static void writefile(String m, String path) 

Method Source Code

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

import java.io.BufferedWriter;
import java.io.File;

import java.io.FileWriter;
import java.io.IOException;

public class Main {
    public static void writefile(String m, String path) {

        try {//w  w w.  j  av a 2  s  .c o m
            File file = new File(path);
            if (!file.exists()) {
                file.createNewFile();
            }
            FileWriter fileWritter = new FileWriter(file.getName(), true);
            BufferedWriter bufferWritter = new BufferedWriter(fileWritter);
            bufferWritter.write(m);
            bufferWritter.close();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. WriteFile(String file)
  2. writeFile(String file, List data)
  3. writeFile(String filename, ArrayList entries)
  4. writeFile(String filename, Map map)
  5. writeFile(String line, File file)
  6. writeFile(String outputLocation, String fileName, List content)
  7. writeFile(String p_name, String p_encoding, String p_content)
  8. writeFileAppend(String filePath, String content)
  9. writeFileContent(File audioFile, short[] data, boolean littleEndian)