Java File Object Create toFile(String fileName, String content)

Here you can find the source of toFile(String fileName, String content)

Description

to File

License

Open Source License

Declaration

public static void toFile(String fileName, String content) throws IOException 

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 toFile(String fileName, String content) throws IOException {
        File file = new File(fileName);
        try (BufferedWriter bw = new BufferedWriter(new FileWriter(file))) {
            bw.write(content);//w w  w.  j a  v a 2s.c o m
            bw.flush();
        }
    }
}

Related

  1. toFile(Map res, String output)
  2. toFile(String base64Code, String targetPath)
  3. toFile(String content, File output)
  4. toFile(String context, String fileName, boolean append)
  5. toFile(String fileName)
  6. toFile(String fileName, String cwd)
  7. toFile(String fileName, String txt)
  8. toFile(String inFile)
  9. toFile(String line)