You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/12/27 08:49:08 UTC

[GitHub] [commons-compress] PostelnicuGeorge commented on a change in pull request #236: COMPRESS-602 - Migrate zip package to use NIO

PostelnicuGeorge commented on a change in pull request #236:
URL: https://github.com/apache/commons-compress/pull/236#discussion_r775398732



##########
File path: src/main/java/org/apache/commons/compress/parallel/FileBasedScatterGatherBackingStore.java
##########
@@ -70,8 +80,8 @@ public void close() throws IOException {
         try {
             closeForWriting();
         } finally {
-            if (target.exists() && !target.delete()) {
-                target.deleteOnExit();
+            if (Files.exists(target)) {
+                Files.deleteIfExists(target);

Review comment:
       Hey Gary you're right, I've read about StandardOpenOption.DELETE_ON_CLOSE and it only works in the same try-with-resources, the way we're passing streams around doesn't so I think we need to think about a general solution or change the way we're using different things.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org