Java Path File Write nio writeToFile(String log, Path path)

Here you can find the source of writeToFile(String log, Path path)

Description

write To File

License

Open Source License

Declaration

public static void writeToFile(String log, Path path) 

Method Source Code

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

import java.io.*;

import java.nio.file.*;

public class Main {
    public static void writeToFile(String log, Path path) {
        try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(path.toFile()))) {
            bufferedWriter.write(log);//  w  w w  .j a v  a  2 s .c om
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. writeTestData(final String testdata, final Path tempfile)
  2. writeToFile(double[] testSample, Path classificationTestFile)
  3. writeToFile(final Path file, final String text)
  4. writeToFile(Path file, boolean isAppendingToFile, List lines)
  5. writeToFile(Path path, String string)
  6. writeToFile(String s, Path file)
  7. writeUntouchedImage(Path sourceFile, Path destFile)