Regards, Upayavira
Tuomo L wrote:
Hi,
I'm using the ZipArchiveSerializer to zip up some files. I need to give the user an option to check a box saying "Delete original files after compression". I wrote a FileDeleteAction, which uses org.apache.avalon.excalibur.io.FileUtil.forceDelete method to delete these files. The action works separately just fine, but when trying to run it inside the same request where ZipArchiveSerialization happens, I get an error indicating that the file(s) couldn't be deleted. It seems that they are still locked for reading by the serializer.
Could someone please check, that the serializer closes all streams etc. correctly, or what else might be the problem?
<map:match uri="foobar.zip"> <map:generate src="some-entries.xml"/> <map:serialize type="zip"/> </map:match>
<map:match uri="compress-and-delete"> <map:act type="do-something-with-the-zip-file"> <map:parameter name="src" value="cocoon:/foobar.zip"/> <map:act type="file-delete"> <map:parameter name="src" value="path-to-the-originals"/> </map:ac> </map:act> </map:match>
-Tuomo
