Java FileWriter Write saveFile(String filePath, String content)

Here you can find the source of saveFile(String filePath, String content)

Description

Saves the supplied content to the specified file path.

License

Open Source License

Declaration

public static void saveFile(String filePath, String content) throws IOException 

Method Source Code

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

import java.io.File;

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

public class Main {
    /**/*from  w w w  .j  a  v a  2  s  .c om*/
     * Saves the supplied content to the specified file path.
     */
    public static void saveFile(String filePath, String content) throws IOException {
        FileWriter fw = new FileWriter(new File(filePath));
        fw.write(content);
        fw.close();
    }
}

Related

  1. saveFile(File file, String contents)
  2. saveFile(File file, String data)
  3. saveFile(File file, String fileContent)
  4. saveFile(File file, String text, boolean append)
  5. saveFile(List contents, String fileName)
  6. saveFile(String filePath, String data)
  7. saveFile(String path, Map> setup)
  8. saveFile(String path, String content)
  9. SaveFile(String path, String data, boolean deleteOnExit)