Java File Write nio writeFile(File file, String text)

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

Description

write File

License

Apache License

Declaration

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

Method Source Code


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

import java.io.File;

import java.io.IOException;

import java.nio.charset.Charset;

import com.google.common.io.Files;

public class Main {
    public static void writeFile(File file, String text) throws IOException {
        Files.write(text, file, Charset.defaultCharset());
    }//  w w  w  .j av  a2  s.  c  om
}

Related

  1. writeFile(File file, String content)
  2. writeFile(File file, String content)
  3. writeFile(FileObject fileObject, String content)
  4. writeFile(List content, String targetFile)
  5. writeFile(OutputStream file, List data)
  6. writeFile(String filename, byte file[])