This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Zipping subdirs along with files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Zipping subdirs along with files" Watch "Zipping subdirs along with files" New topic

Zipping subdirs along with files


Joined: May 29, 2001
Posts: 1
I need to zip up the contents of a selected directory. Zipping up files in this directory is no problem. However, my 'ziiping' needs to take into account if the dir has subdirs in them. Does anyone have some code examples that I could see for this? I was thinking that I need to utilize recursion. Any help is appreciated.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Zipping subdirs along with files
It's not a secret anymore!