Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Zip HTML Files in Java

Options
  • 26-08-2014 3:20pm
    #1
    Registered Users Posts: 2,701 ✭✭✭


    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 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 Posts: 2,701 ✭✭✭ec18


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


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




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