This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to extract rar or zip files in java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to extract rar or zip files in java?" Watch "how to extract rar or zip files in java?" New topic
Author

how to extract rar or zip files in java?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

i have a requirement of extracting a zip file but the problem is that
the zip file contains nested filders and files are present in that folders
  • say like scr-->main-->helloword.class

  • the util.zip only works when there is just files in zip format , but in my case there are folder,
    the util.zip is not working
    can you have any alternative to this ?


    The Only way to learn is ...........do!
    Visit my blog http://inaved-momin.blogspot.com/
    Paul Clapham
    Sheriff

    Joined: Oct 14, 2005
    Posts: 19728
        
      10

    You don't need an alternative. Java and the java.util.zip package is perfectly capable of dealing with folders within archives. I expect you haven't written your code to do that.
    naved momin
    Ranch Hand

    Joined: Jul 03, 2011
    Posts: 692

    Paul Clapham wrote:You don't need an alternative. Java and the java.util.zip package is perfectly capable of dealing with folders within archives. I expect you haven't written your code to do that.

    this is the code
    what else should i do
    to get that functionality up
    Tim Moores
    Rancher

    Joined: Sep 21, 2011
    Posts: 2409
    That code only ever writes to a single file - how do think it would extract multiple files and/or directories?
    naved momin
    Ranch Hand

    Joined: Jul 03, 2011
    Posts: 692

    Tim Moores wrote:That code only ever writes to a single file - how do think it would extract multiple files and/or directories?

    can you modify my code to show
    me how to do that , please?
    Tim Moores
    Rancher

    Joined: Sep 21, 2011
    Posts: 2409
    No, I have better things to do. Start here: http://java.sun.com/developer/technicalArticles/Programming/compression/
     
    Have you checked out Aspose?
     
    subject: how to extract rar or zip files in java?
     
    It's not a secret anymore!