Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating zip containg both files and folders

 
Mrunal Pawar
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • 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...

 
Maneesh Godbole
Saloon Keeper
Posts: 10967
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SearchFirst. This question comes up every now and then, and has been answered before.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic