Java Text File Save writeFile(ArrayList lines, String dest_path)

Here you can find the source of writeFile(ArrayList lines, String dest_path)

Description

write File

License

Open Source License

Declaration

public static void writeFile(ArrayList<String> lines, String dest_path) 

Method Source Code

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

import java.io.File;

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

import java.util.ArrayList;

public class Main {
    public static void writeFile(ArrayList<String> lines, String dest_path) {
        FileWriter writer;/* w  w  w  .  j a va2s. c o m*/
        try {
            writer = new FileWriter(dest_path);
            for (String str : lines) {
                writer.write(str);
            }
            writer.close();
        } catch (IOException e) {
            System.out.println("ERROR: FileUtils: writeFile: Error in the I/O! exception was: " + e.toString());
        }
        File dest = new File(dest_path);
        dest.setExecutable(true);
    }
}

Related

  1. serialize(final File folder, final String content, final String fileName)
  2. setText(File file, String text)
  3. writeFile(Collection emailTree, String destFile)
  4. writeFile(File destinationFile, String contents, String encoding)
  5. writeFile(File outputDirectory, String fileName, String source)
  6. writeFile(File outputFile, ArrayList sortedLines, String lineSeparator)