Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Kondaka <[email protected]>
  • Loading branch information
kkondaka committed Nov 29, 2023
1 parent b1d6108 commit d1b513e
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,11 @@ public void shutdown() {

@Override
public void initialize() {
final StandardOpenOption[] openOptions = appendMode ?
new StandardOpenOption[] {StandardOpenOption.APPEND, StandardOpenOption.CREATE, StandardOpenOption.WRITE} :
new StandardOpenOption[] {};
try {
if (appendMode) {


writer = Files.newBufferedWriter(Paths.get(outputFilePath), StandardCharsets.UTF_8, StandardOpenOption.APPEND, StandardOpenOption.CREATE, StandardOpenOption.WRITE);
} else {
writer = Files.newBufferedWriter(Paths.get(outputFilePath), StandardCharsets.UTF_8);
}
writer = Files.newBufferedWriter(Paths.get(outputFilePath), StandardCharsets.UTF_8, openOptions);
} catch (final IOException ex) {
throw new RuntimeException(format("Encountered exception opening/creating file %s", outputFilePath), ex);
}
Expand Down

0 comments on commit d1b513e

Please sign in to comment.