Java Text File Save writeFile(String pContent, String pPath)

Here you can find the source of writeFile(String pContent, String pPath)

Description

write File

License

Open Source License

Declaration

public static void writeFile(String pContent, String pPath) 

Method Source Code


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

import java.io.BufferedWriter;
import java.io.File;

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

public class Main {
    public static void writeFile(String pContent, String pPath) {
        File file = new File(pPath);
        FileWriter fstream;/* w ww  . j  av  a2 s.  c om*/
        try {
            fstream = new FileWriter(file);
            try (BufferedWriter out = new BufferedWriter(fstream)) {
                out.write(pContent);
            }
        } catch (IOException e) {
            System.err.println("Error: " + e.getMessage());
        }
    }
}

Related

  1. writeFile(String path, String fileName, String data)
  2. writeFile(String path, String text)
  3. writeFile(String path, String text)
  4. writeFile(String path, String text, boolean orverWite)
  5. writeFile(String path, Vector contents)
  6. writeFile(String ruta, String nombre, byte[] archivo)
  7. WriteFile(String sFileName, String content)
  8. writeFile(String sFileName, String sContent)
  9. writeFile(String sName, String data, String encoding)