not really put extra effort in deleting temp file
@@ -70,7 +70,9 @@ public void close() throws IOException {
try {
closeForWriting();
} finally {
- target.delete();
+ if (target.exists() && !target.delete()) {
+ target.deleteOnExit();
+ }
}
}
}
