public class OutputFileTerminal extends Object implements IOutputTerminal, IFileTerminal
Implements a terminal whose output is to be written to a file in some working directory.
Constructor and Description |
---|
OutputFileTerminal(IOutputWorkingDirectory workingDirectory)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getFileName()
Gets the file name.
|
OutputStream |
getStream()
Gets the underlying stream.
|
BufferedWriter |
getWriter()
Gets the writer for the output terminal.
|
void |
setFileName(String value)
Sets the file name.
|
void |
writeFile()
Finalizes the log, e.g., writes it to file.
|
public OutputFileTerminal(IOutputWorkingDirectory workingDirectory)
Creates new instance.
workingDirectory
- The working directory.public String getFileName()
Gets the file name.
getFileName
in interface IFileTerminal
public void setFileName(String value)
Sets the file name.
setFileName
in interface IFileTerminal
value
- The file name.public BufferedWriter getWriter()
Gets the writer for the output terminal.
getWriter
in interface IOutputTerminal
BufferedWriter
class instance.public OutputStream getStream()
Gets the underlying stream.
getStream
in interface IOutputTerminal
public void writeFile() throws IOException
Finalizes the log, e.g., writes it to file.
writeFile
in interface IFileTerminal
IOException
- when file writing fails.Copyright © 2022 Aspose. All Rights Reserved.