public class PrintWriterUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
closePrintWriter(File file,
PrintWriter printWriter)
Closes the given print writer, or flushes it if is the standard output.
|
static PrintWriter |
createPrintWriter(File outputFile,
PrintWriter console)
Returns a print writer for the given file, or the standard output if
the file name is empty.
|
static PrintWriter |
createPrintWriter(File outputFile,
PrintWriter console,
boolean append)
Returns a print writer for the given file, or the standard output if
the file name is empty.
|
static PrintWriter |
createPrintWriterErr(File outputFile)
Returns a print writer for the given file, or the standard output if
the file name is empty.
|
static PrintWriter |
createPrintWriterOut(File outputFile)
Returns a print writer for the given file, or the standard output if
the file name is empty.
|
static PrintWriter |
createPrintWriterOut(File outputFile,
boolean append)
Returns a print writer for the given file, or the standard output if
the file name is empty.
|
static String |
fileName(File file)
Returns the canonical file name for the given file, or "standard output"
if the file name is empty.
|
public static PrintWriter createPrintWriterOut(File outputFile) throws FileNotFoundException, UnsupportedEncodingException
public static PrintWriter createPrintWriterOut(File outputFile, boolean append) throws FileNotFoundException, UnsupportedEncodingException
public static PrintWriter createPrintWriterErr(File outputFile) throws FileNotFoundException, UnsupportedEncodingException
public static PrintWriter createPrintWriter(File outputFile, PrintWriter console) throws FileNotFoundException, UnsupportedEncodingException
public static PrintWriter createPrintWriter(File outputFile, PrintWriter console, boolean append) throws FileNotFoundException, UnsupportedEncodingException
public static void closePrintWriter(File file, PrintWriter printWriter)
Copyright © 2019. All rights reserved.