• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Creating zip containg both files and folders

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have to create zip file. zip file may contain only files(without any folder structure)/folders/both.....& that I will select at run time
i.e. step for creating
1. first I will select files/Folder/both by using JFileChooser
2. then I will give zip file name which i want to create
3. when i clicked on create zip button then it should create a zip file containg all file and folders

currently I have added all the file paths and folder paths which i want to zipped in a list, but it is not get zipped properly, folder structure is not created properly

Please give me the code for creating zip file containing both files and folders.
Please reply soon...

thanks...

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mrunal,
Welcome to the Ranch.

Please give me the code for creating zip file containing both files and folders.


Unfortunately, we do not hand out ready made code here at the Ranch. Show us what you have got so far, tell us where you are stuck, and we will help you point in the right direction.
Do take a look at http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch

Have you looked at this article which shows how to zip/unzip files?
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SearchFirst. This question comes up every now and then, and has been answered before.
 
It's exactly the same and completely different as this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic