Java Stream Close closeReportFile()

Here you can find the source of closeReportFile()

Description

close Report File

License

Apache License

Declaration

static void closeReportFile() throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class Main {
    private static String oreppath = "";
    private static boolean wor = false;

    static void closeReportFile() throws IOException {
        if (wor) {
            return;
        }//from  www.j  a  va  2  s .co  m

        File orepfile = new File(oreppath);
        try (PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(orepfile, true)))) {
            pw.println("</REPORT>");
        }
    }
}

Related

  1. closeReader(Reader r)
  2. closeReader(Reader reader)
  3. closeReader(Reader reader)
  4. closeReader(Reader rReader)
  5. closeRelaxed(Closeable resource)
  6. closeResource(final Closeable aResource)
  7. closeSafe(InputStream inputStream)
  8. closeSafely(final FileOutputStream output)
  9. closeSafely(InputStream is)