Results 1 to 4 of 4

Thread: Is there any api for zipping and unzipping in spring or Spring integration

  1. #1

    Default Is there any api for zipping and unzipping in spring or Spring integration

    hi everyone,

    I had a requirement in which i will be zipping and unzipping files ,is there any support for it in spring and spring integration . I know there is an api available in java to do this but wanted to know does spring has any api for this

  2. #2
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    Its pretty straight forward using the Zip(GZip)OutputStream and Zip(GZip)InputStream from java.util.zip package. What is it that you are looking for that you aren't able to achieve using this?

  3. #3

    Default

    I can definitely achieve using java.util.zip package just wanted to know any transformers available in spring . And i have one issue in that amol.If the zip file contains a folder inside it then it throws an exception java.io.IOException: Write error .So i have to manually create those folder where i want to zip then it works .Any solution for this so that when unzipping if there is a folder it creates the folder automatically and unzippes it

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    It should work if you use the ZipFile and then iterate over the entries in the file, instead of using the Zip based streams directly. We had some issues with using those directly, using ZipFile saved the day for us.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •