CAMEL-8279: added backwards compatibility
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/344e7a5c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/344e7a5c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/344e7a5c Branch: refs/heads/master Commit: 344e7a5cbc122184c10935f5dab5985c4e6859ea Parents: c307096 Author: Ranil Wijeyratne <[email protected]> Authored: Sun Jan 25 20:02:47 2015 +0100 Committer: Claus Ibsen <[email protected]> Committed: Mon Jan 26 14:50:16 2015 +0100 ---------------------------------------------------------------------- .../processor/aggregate/zipfile/ZipAggregationStrategy.java | 8 ++++++++ .../zipfile/AggregationStrategyWithFilenameHeaderTest.java | 2 +- .../zipfile/AggregationStrategyWithPreservationTest.java | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/344e7a5c/components/camel-zipfile/src/main/java/org/apache/camel/processor/aggregate/zipfile/ZipAggregationStrategy.java ---------------------------------------------------------------------- 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 b1105fa..a6b7a0c 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 @@ -55,6 +55,14 @@ public class ZipAggregationStrategy implements AggregationStrategy { public ZipAggregationStrategy() { this(false, false); } + + /** + * @param preserveFolderStructure if true, the folder structure is preserved when the source is + * a type of {@link GenericFileMessage}. If used with a file, use recursive=true. + */ + public ZipAggregationStrategy(boolean preserveFolderStructure) { + this(preserveFolderStructure, false); + } /** * @param preserveFolderStructure if true, the folder structure is preserved when the source is http://git-wip-us.apache.org/repos/asf/camel/blob/344e7a5c/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithFilenameHeaderTest.java ---------------------------------------------------------------------- diff --git a/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithFilenameHeaderTest.java b/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithFilenameHeaderTest.java index 2d31722..6e1403a 100644 --- a/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithFilenameHeaderTest.java +++ b/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithFilenameHeaderTest.java @@ -67,7 +67,7 @@ public class AggregationStrategyWithFilenameHeaderTest extends CamelTestSupport final ZipEntry entry = entries.nextElement(); assertTrue("Zip entry file name should be on of: " + FILE_NAMES, FILE_NAMES.contains(entry.getName())); } - assertEquals("Zip file should contains " + FILE_NAMES.size() + " files", FILE_NAMES.size(), fileCount); + assertEquals("Zip file should contain " + FILE_NAMES.size() + " files", FILE_NAMES.size(), fileCount); } finally { IOHelper.close(file); } http://git-wip-us.apache.org/repos/asf/camel/blob/344e7a5c/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithPreservationTest.java ---------------------------------------------------------------------- diff --git a/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithPreservationTest.java b/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithPreservationTest.java index 4fc6ac7..9c40cad 100644 --- a/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithPreservationTest.java +++ b/components/camel-zipfile/src/test/java/org/apache/camel/processor/aggregate/zipfile/AggregationStrategyWithPreservationTest.java @@ -78,7 +78,7 @@ public class AggregationStrategyWithPreservationTest extends CamelTestSupport { public void configure() throws Exception { // Unzip file and Split it according to FileEntry from("file:src/test/resources/org/apache/camel/aggregate/zipfile/data?consumer.delay=1000&noop=true&recursive=true") - .aggregate(new ZipAggregationStrategy(true, false)) + .aggregate(new ZipAggregationStrategy(true)) .constant(true) .completionFromBatchConsumer() .eagerCheckCompletion()
