Skip to content

Commit

Permalink
Fixed code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
arybakov-cgi committed Nov 28, 2023
1 parent a597378 commit 10a2eb5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ private void saveBinaryResponseToFile(byte[] resultBinary, String reportFile) th
String pathToFile = TMP + File.separator + reportFile;
logger.debug("Save generated PDF {} on the file system", reportFile);
File fileToSave = new File(pathToFile);
if(fileToSave.exists()) {
boolean isDeleted = fileToSave.delete();
logger.debug("{} to delete existing PDF {}", isDeleted, reportFile);
boolean isDeleted = Files.deleteIfExists(fileToSave.toPath());
if(isDeleted) {
logger.debug("Delete existing PDF {}", reportFile);
}
Files.write(fileToSave.toPath(), resultBinary);
logger.debug("PDF {} saved successfully", pathToFile);
Expand Down

0 comments on commit 10a2eb5

Please sign in to comment.