aspose file tools*
The moose likes Beginning Java and the fly likes Creating zip containg both files and folders Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Creating zip containg both files and folders" Watch "Creating zip containg both files and folders" New topic
Author

Creating zip containg both files and folders

Mrunal Pawar
Greenhorn

Joined: Feb 03, 2010
Posts: 1
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

Joined: Jul 26, 2007
Posts: 10523
    
    9

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?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

SearchFirst. This question comes up every now and then, and has been answered before.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Consider Paul's rocket mass heater.
 
subject: Creating zip containg both files and folders