Java Text File Write writeStringToFile(String modifiedLine, String filePath)

Here you can find the source of writeStringToFile(String modifiedLine, String filePath)

Description

write String To File

License

Open Source License

Declaration

public static void writeStringToFile(String modifiedLine,
            String filePath) 

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 writeStringToFile(String modifiedLine,
            String filePath) {/*from   ww w .  j a v  a 2  s  .c o  m*/

        BufferedWriter bw = null;
        try {
            bw = new BufferedWriter(new FileWriter(filePath, true));
            bw.write(modifiedLine + "\n");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                bw.flush();
                bw.close();
            } catch (IOException e) {
                e.printStackTrace();
            }

        }

    }
}

Related

  1. WriteStringToFile(String fn, String dest)
  2. writeStringToFile(String fullPath, byte[] fileBytes)
  3. writeStringToFile(String fullPath, String content)
  4. writeStringToFile(String jsonStr, File file)
  5. writeStringToFile(String macroContent, File file)
  6. writeStringToFile(String path, String content)
  7. writeStringToFile(String path, String content)
  8. writeStringToFile(String path, String content)
  9. writeStringToFile(String path, String contents)