spring-projects / spring-integration-extensions

The Spring Integration Extensions project provides extension components for Spring Integration
http://www.springintegration.org/
279 stars 265 forks source link

ZipTransformer: "deleteFiles" throwing exception #164

Closed muraliyaj closed 7 years ago

muraliyaj commented 8 years ago

Issue: deleteFiles=true causing below exception .

org.zeroturnaround.zip.ZipException: java.io.FileNotFoundException: <Abosulate Path of File with File name>The system cannot find the file specified)

Reason: Inside ZipTransformer, deleteFiles is used to delete the original file before corresponding FileSource is used to compress the file. That is causing FileNotFoundException.

artembilan commented 8 years ago

Thank you for reporting this!

Really bug. Confirmed with simple zipTransformer.setDeleteFiles(true); modification to the ZipTransformerTests.zipFile() test-case.

Will be fixed soon.

muraliyaj commented 8 years ago

Thank you Artem.

muraliyaj commented 8 years ago

Also, This ZIP transformer may need 'error handling mechanism( like error output channel or hook points to advice chain)' to handle failed compression cases like disk full or issues with output channel.

artembilan commented 8 years ago

The error handling isn't Transfrormer responsibility. The thrown Exception can be simply try...catched by the caller upstream or send to the errorChannel in case of async hand off.

In addition, with Java Config the @Transformer annotation can be supplied with adviceChain where one of that can be ExpressionEvaluatingRequestHandlerAdvice. But, eh, I agree that we have missed <request-hadnler-advice-chain> there for the <int-zip:zip-transformer>. Will fix here as well.