diff --git a/src/main/java/htsjdk/samtools/util/IOUtil.java b/src/main/java/htsjdk/samtools/util/IOUtil.java index 40bfd0342c..8b811f9314 100644 --- a/src/main/java/htsjdk/samtools/util/IOUtil.java +++ b/src/main/java/htsjdk/samtools/util/IOUtil.java @@ -360,16 +360,16 @@ public static void deleteOnExit(final Path path) { * * @see #deleteOnExit(Path) */ - protected static final class DeletePathThread extends Thread { + static final class DeletePathThread extends Thread { private final Path path; - protected DeletePathThread(Path path) {this.path = path;} + DeletePathThread(Path path) {this.path = path;} @Override public void run() { try { - Files.delete(path); + Files.deleteIfExists(path); } catch (IOException e) { throw new RuntimeIOException(e); }