Java PrintWriter Write saveFile(String path, String text)

Here you can find the source of saveFile(String path, String text)

Description

save File

License

Open Source License

Declaration

public static void saveFile(String path, String text) throws IOException 

Method Source Code


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

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;

public class Main {
    public static void saveFile(String path, String text) throws IOException {
        PrintWriter out;/*  w  ww  .  j  a v a 2  s. com*/
        try {
            out = new PrintWriter(path);
            out.print(text);
            out.close();
        } catch (FileNotFoundException e) {
            throw e;
        }
    }
}

Related

  1. save(String s, File file)
  2. saveChiPhiTableCsv(PrintWriter wr, double[][] coefficients, String[] labelNames)
  3. saveConvert(final String text, final int escapeMode, final PrintWriter writer)
  4. saveFile(File f, String text)
  5. saveFile(String fileName, String data)
  6. saveHeatmapTableCsv(PrintWriter wr, double[][] coefficients, String[] labelNames)
  7. saveLastExpInfo(String fileName, int[] info)
  8. saveLine(File file, String line)
  9. saveList(List list, OutputStream outs)