You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/07/19 07:36:52 UTC

[camel] 02/03: CAMEL-13399: Truncate zip entry, if already exists

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

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

commit 6e5cf74f0d7646907cd91768d0e8aa19c1bfe6d0
Author: Jan Bednář <ma...@janbednar.eu>
AuthorDate: Wed Jul 17 21:01:23 2019 +0200

    CAMEL-13399: Truncate zip entry, if already exists
---
 .../camel/processor/aggregate/zipfile/ZipAggregationStrategy.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-zipfile/src/main/java/org/apache/camel/processor/aggregate/zipfile/ZipAggregationStrategy.java b/components/camel-zipfile/src/main/java/org/apache/camel/processor/aggregate/zipfile/ZipAggregationStrategy.java
index b6e3454..4aa7fc8 100644
--- a/components/camel-zipfile/src/main/java/org/apache/camel/processor/aggregate/zipfile/ZipAggregationStrategy.java
+++ b/components/camel-zipfile/src/main/java/org/apache/camel/processor/aggregate/zipfile/ZipAggregationStrategy.java
@@ -236,7 +236,7 @@ public class ZipAggregationStrategy implements AggregationStrategy {
         try (FileSystem fs = FileSystems.newFileSystem(getZipURI(zipFile), env)) {
             Path dest = fs.getPath("/", entryName);
             Files.createDirectories(dest.getParent());
-            Files.write(dest, buffer, StandardOpenOption.CREATE);
+            Files.write(dest, buffer, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
         }
     }