Android File Copy copyStringToFile(String content, String FilePath)

Here you can find the source of copyStringToFile(String content, String FilePath)

Description

Copy String to a File.

Parameter

Parameter Description

Exception

Parameter Description
IOException an exception

Declaration

public static void copyStringToFile(String content, String FilePath)
        throws IOException 

Method Source Code

//package com.java2s;

import java.io.BufferedWriter;

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

public class Main {
    /**/*from w  w w. ja  v a2s  .c o m*/
     * Copy String to a File.
     * 
     * @param content: String content to be copied to the File.
     * @param FilePath: File Absolute Path.
     * 
     * @throws IOException
     */
    public static void copyStringToFile(String content, String FilePath)
            throws IOException {
        FileWriter fstream = new FileWriter(FilePath);
        BufferedWriter out = new BufferedWriter(fstream);
        out.write(content);
        out.close();
    }
}

Related

  1. copyFileLazy(String source, String destination)
  2. copyFileToFile(File file, File outFile)
  3. copyFiles(File src, File dst)
  4. copyImgFile(String sourcePath, String fileId)
  5. copyResource(Class cls, String strResSource, String strFile)
  6. copyfile(File source, File destination)
  7. dumbfilecopy(File source, File dest)
  8. fileCopy(File dbFile, File backup)
  9. fileCopy(File sourcefile, File destinctionFile)