bsmolicek commented on code in PR #1943:
URL: 
https://github.com/apache/camel-spring-boot/pull/1943#discussion_r3950107002


##########
components-starter/camel-zipfile-starter/src/test/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatTest.java:
##########
@@ -354,8 +354,7 @@ public void configure() {
                                 @Override
                                 public void process(Exchange exchange) throws 
Exception {
                                     ZipFile zfile = new ZipFile(new 
File("src/test/resources/hello.odt"));
-                                    ZipEntry entry = new ZipEntry(
-                                            (String) 
exchange.getIn().getHeader(Exchange.FILE_NAME));
+                                    ZipEntry entry = new ZipEntry((String) 
exchange.getIn().getHeader("zipFileName"));

Review Comment:
   It is set by Camel core’s 
[ZipIterator](https://github.com/apache/camel/blob/main/components/camel-zipfile/src/main/java/org/apache/camel/dataformat/zipfile/ZipIterator.java#L143-L151)
 when it iterates each ZIP entry:
   
   ```
     String zipFileName = currentEntry.getName();
     answer.setHeader("zipFileName", zipFileName);
     answer.setHeader(Exchange.FILE_NAME, FileUtil.stripPath(zipFileName));
   ```
   
   looks weird, but should be correct, it's also used by 
https://github.com/apache/camel-spring-boot/blob/main/components-starter/camel-zipfile-starter/src/test/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileMultipleFilesSplitterTest.java#L97
 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to