Skip to content

Commit

Permalink
Delete file on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
ghilainm committed Dec 10, 2024
1 parent 36c1b38 commit 89c66bf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ private void addDefaultAccessFilter() {

private static Path createDefaultAgentConfigTempFile() {
try {
return Files.createTempFile(ACCESS_FILTER_PREFIX, ACCESS_FILTER_SUFFIX);
Path tempFile = Files.createTempFile(ACCESS_FILTER_PREFIX, ACCESS_FILTER_SUFFIX);
tempFile.toFile().deleteOnExit();
return tempFile;
} catch (IOException e) {
throw new RuntimeException("Cannot create temporary file for access filter", e);
}
Expand Down

0 comments on commit 89c66bf

Please sign in to comment.