commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [3/3] commons-compress git commit: not really COMPRESS-470: put extra effort in deleting temp file
Date Sun, 18 Nov 2018 16:02:55 GMT
not really COMPRESS-470: put extra effort in deleting temp file


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/f132d6c5
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/f132d6c5
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/f132d6c5

Branch: refs/heads/master
Commit: f132d6c50285b7a7652909aa85a5afdb3b828939
Parents: 5417fb4
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sun Nov 18 17:02:14 2018 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sun Nov 18 17:02:14 2018 +0100

----------------------------------------------------------------------
 .../compress/parallel/FileBasedScatterGatherBackingStore.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/f132d6c5/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java
b/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java
index a9105f0..d36e389 100644
--- a/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java
+++ b/src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java
@@ -70,7 +70,9 @@ public class FileBasedScatterGatherBackingStore implements ScatterGatherBackingS
         try {
             closeForWriting();
         } finally {
-            target.delete();
+            if (target.exists() && !target.delete()) {
+                target.deleteOnExit();
+            }
         }
     }
 }


Mime
View raw message