aspose file tools*
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
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
    Bartender

    Joined: Oct 14, 2005
    Posts: 18541
        
        8

    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: 2408
    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: 2408
    No, I have better things to do. Start here: http://java.sun.com/developer/technicalArticles/Programming/compression/
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: how to extract rar or zip files in java?