You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2020/07/28 19:51:28 UTC

[ant] branch master updated: document why we are actually removing the file before writing

This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant.git


The following commit(s) were added to refs/heads/master by this push:
     new f7159e8  document why we are actually removing the file before writing
f7159e8 is described below

commit f7159e8a084a3fcb76b933d393df1fc855d74d78
Author: Stefan Bodewig <bo...@apache.org>
AuthorDate: Tue Jul 28 21:51:01 2020 +0200

    document why we are actually removing the file before writing
---
 src/main/org/apache/tools/ant/types/resources/FileResource.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/org/apache/tools/ant/types/resources/FileResource.java b/src/main/org/apache/tools/ant/types/resources/FileResource.java
index d8d604c..17ed7cc 100644
--- a/src/main/org/apache/tools/ant/types/resources/FileResource.java
+++ b/src/main/org/apache/tools/ant/types/resources/FileResource.java
@@ -255,7 +255,8 @@ public class FileResource extends Resource implements Touchable, FileProvider,
     private OutputStream getOutputStream(boolean append) throws IOException {
         File f = getNotNullFile();
         if (f.exists()) {
-            if (f.isFile() && !append) {
+            if (Files.isSymbolicLink(f.toPath()) && f.isFile() && !append) {
+                // https://bz.apache.org/bugzilla/show_bug.cgi?id=624
                 f.delete();
             }
         } else {