Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Zip HTML Files in Java

  • 26-08-2014 03:20PM
    #1
    Registered Users, Registered Users 2 Posts: 2,792 ✭✭✭


    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?
    Tagged:


Comments

  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭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.


  • Registered Users, Registered Users 2 Posts: 2,792 ✭✭✭ec18


    Thanks I'm using the zip output stream and zipoutputstream.putnextentry() ........ any recommendation on a compression library?


  • Registered Users, Registered Users 2 Posts: 7,157 ✭✭✭srsly78




  • Registered Users, Registered Users 2 Posts: 2,792 ✭✭✭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.


Advertisement