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/07/25 18:44:15 UTC

[GitHub] [commons-io] garydgregory commented on a change in pull request #251: [IO-744] FileWriterWithEncoding for an existing file no longer truncates the file.

garydgregory commented on a change in pull request #251:
URL: https://github.com/apache/commons-io/pull/251#discussion_r676186513



##########
File path: src/main/java/org/apache/commons/io/output/FileWriterWithEncoding.java
##########
@@ -227,7 +227,12 @@ private static Writer initWriter(final File file, final Object encoding, final b
         OutputStream stream = null;
         final boolean fileExistedAlready = file.exists();
         try {
-            stream = Files.newOutputStream(file.toPath(),  append ? StandardOpenOption.APPEND : StandardOpenOption.CREATE);
+            if (append) {

Review comment:
       Not sure why the fix has to be exploded into so much code when all you need is an additional argument to the JRE API. Please see git master for a much simpler fix.
   




-- 
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