Discussions
Categories
Groups
Advertisement
Child Item
Home
Topics
Technology & Internet
Software & Web Development
Development
Zip HTML Files in Java
ec18
Hi,
I have a folder of html files and their associated folders. eg index.html and index. I'm trying to write some java code to create a zip containing the .html and the folder. The current code I have zips the files but places all the files in the index folder in the top level of the . Is there a way to code that allows java to create a xip file preserving the html with folder structure?
Find more posts tagged with
zip
java
i/o
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
Advertisement
Advertisement
Comments
srsly78
Yes it should be just an extra parameter passed to whatever compression library you use. If your compression library doesn't offer this feature then use a better one. Refer to the documentation.
ec18
Thanks I'm using the zip output stream and zipoutputstream.putnextentry() ........ any recommendation on a compression library?
srsly78
A quick google search returns relevant stuff:
http://stackoverflow.com/questions/1399126/java-util-zip-recreating-directory-structure
ec18
What I wanted to do was actually easier.....All I needed to do as add the folder structure that I wanted to the file Input stream and it recreated the structure I needed.