Skip to content

Commit 2b13026

Browse files
Delete temporary files on exit.
It is not enough to just delete the parent directory on exit, since it is not empty if the files aren't deleted, and deletion of a non-empty directory fails.
1 parent d9167ca commit 2b13026

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/TLSTester.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ private void fetchResource(String resource) throws IOException {
102102
tempDir.deleteOnExit();
103103
}
104104
File outPath = new File(tempDir, resource.substring(1));
105+
outPath.deleteOnExit();
105106
try (InputStream in = fetchData(resource); FileOutputStream out = new FileOutputStream(outPath)) {
106107
byte[] buffer = new byte[12];
107108
while (true) {

0 commit comments

Comments
 (0)