Java FileWriter Write saveTextFile(String fileName, String text)

Here you can find the source of saveTextFile(String fileName, String text)

Description

save Text File

License

Open Source License

Declaration

public static void saveTextFile(String fileName, String text) 

Method Source Code

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

import java.io.BufferedWriter;

import java.io.FileWriter;
import java.io.IOException;

public class Main {
    public static void saveTextFile(String fileName, String text) {
        BufferedWriter writer = null;
        try {//from   w  w w  .  ja  v  a 2s. c o  m
            writer = new BufferedWriter(new FileWriter(fileName));
            writer.write(text);

        } catch (IOException e) {
        } finally {
            try {
                if (writer != null)
                    writer.close();
            } catch (IOException e) {
            }
        }
    }
}

Related

  1. saveTemporaryTermFile(File tempLocation, String word, Collection termList)
  2. saveText(java.io.File f, String text)
  3. saveTextFile(File file, String text)
  4. saveTextFile(String content, File file, boolean append)
  5. saveTextFile(String contents, File file)
  6. saveToCache(String md, String in, String res)
  7. saveToFile(File file, String string)
  8. saveToFile(File file, String text)
  9. saveToFile(List lines, String pathname)