Java Write String to File writeFile(File file, String content)

Here you can find the source of writeFile(File file, String content)

Description

write File

License

Apache License

Declaration

public static void writeFile(File file, String content) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

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

public class Main {
    public static void writeFile(File file, String content) throws IOException {
        writeFile(file, content, false);
    }/*from w  w w .  ja  va2 s  .  co m*/

    public static void writeFile(File file, String content, boolean append) throws IOException {
        BufferedWriter writer = new BufferedWriter(new FileWriter(file, append));
        writer.write(content);
        writer.close();
    }
}

Related

  1. writeFile(File f, String str)
  2. writeFile(File f, String text)
  3. writeFile(File file, Iterable lines)
  4. writeFile(File file, String content)
  5. writeFile(File file, String content)
  6. writeFile(File file, String content)
  7. writeFile(File file, String content)
  8. writeFile(File file, String content)
  9. writeFile(File file, String content)