Skip to content

Commit

Permalink
More debugging added
Browse files Browse the repository at this point in the history
  • Loading branch information
arybakov-cgi committed Nov 28, 2023
1 parent 7cb2391 commit 742e5bf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,12 @@ private void saveBinaryResponseToFile(byte[] resultBinary, String reportFile) th
if(resultBinary.length > 0) {
String pathToFile = TMP + File.pathSeparator + reportFile;
logger.debug("Save generated PDF {} on the file system", reportFile);
FileUtils.writeByteArrayToFile(new File(pathToFile), resultBinary);
File fileToSave = new File(pathToFile);
if(fileToSave.exists()) {
boolean isDeleted = fileToSave.delete();
logger.debug("{} to delete existing PDF {}", isDeleted, reportFile);
}
FileUtils.writeByteArrayToFile(fileToSave, resultBinary);
logger.debug("PDF {} saved successfully", pathToFile);
}
}
Expand Down

0 comments on commit 742e5bf

Please sign in to comment.