Browse Source

document why we are actually removing the file before writing

master
Stefan Bodewig 4 years ago
parent
commit
f7159e8a08
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/main/org/apache/tools/ant/types/resources/FileResource.java

+ 2
- 1
src/main/org/apache/tools/ant/types/resources/FileResource.java View File

@@ -255,7 +255,8 @@ public class FileResource extends Resource implements Touchable, FileProvider,
private OutputStream getOutputStream(boolean append) throws IOException { private OutputStream getOutputStream(boolean append) throws IOException {
File f = getNotNullFile(); File f = getNotNullFile();
if (f.exists()) { 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(); f.delete();
} }
} else { } else {


Loading…
Cancel
Save