Java PrintWriter Write saveLine(File file, String line)

Here you can find the source of saveLine(File file, String line)

Description

save Line

License

Open Source License

Declaration

public static void saveLine(File file, String line) throws FileNotFoundException 

Method Source Code


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

import java.io.File;
import java.io.FileNotFoundException;

import java.io.PrintWriter;

public class Main {
    public static void saveLine(String path, String line) throws FileNotFoundException {
        saveLine(new File(path), line);
    }/* w  w w.ja va2s.  com*/

    public static void saveLine(File file, String line) throws FileNotFoundException {
        PrintWriter output = new PrintWriter(file);
        output.print(line);
        output.close();
    }
}

Related

  1. saveFile(File f, String text)
  2. saveFile(String fileName, String data)
  3. saveFile(String path, String text)
  4. saveHeatmapTableCsv(PrintWriter wr, double[][] coefficients, String[] labelNames)
  5. saveLastExpInfo(String fileName, int[] info)
  6. saveList(List list, OutputStream outs)
  7. saveMatrixAsADM(AtomicReferenceArray matrix, String path)
  8. saveMineField(File fileName, String mineField)
  9. saveProbabilityData(String file, double[] probabilities, double start, double dt)