Java PrintWriter Write save(String s, File file)

Here you can find the source of save(String s, File file)

Description

save

License

Open Source License

Declaration

public static void save(String s, File file) 

Method Source Code

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

import java.io.File;

import java.io.PrintWriter;

public class Main {
    public static void save(String s, File file) {
        try {//from ww  w. j a  v  a 2s  .  c om
            PrintWriter out = new PrintWriter(file);
            out.println(s);
            out.flush();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related

  1. save(final Multimap map, final Writer target, final String sep)
  2. save(Map map, String fileName)
  3. save(String fileName, List list)
  4. saveChiPhiTableCsv(PrintWriter wr, double[][] coefficients, String[] labelNames)
  5. saveConvert(final String text, final int escapeMode, final PrintWriter writer)
  6. saveFile(File f, String text)
  7. saveFile(String fileName, String data)