• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

how to extract rar or zip files in java?

 
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
     
    Marshal
    Posts: 26909
    82
    Eclipse IDE Firefox Browser MySQL Database
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Posts: 692
    Eclipse IDE Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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
     
    Saloon Keeper
    Posts: 7164
    165
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    That code only ever writes to a single file - how do think it would extract multiple files and/or directories?
     
    naved momin
    Ranch Hand
    Posts: 692
    Eclipse IDE Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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
    Saloon Keeper
    Posts: 7164
    165
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    No, I have better things to do. Start here: http://java.sun.com/developer/technicalArticles/Programming/compression/
     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic