简体   繁体   中英

Archive a folder in Java using truezip

I need to create a service that finds specific folders and archives them into on zip file.

I saw all kind of examples , but it seems that have to read all the files in every folder. Am I right?

Is there another way to do that (maybe using truezip for that matter)?

I want to use truezip since I understood you could easily add files/folders to a zip file.

I've searched for a simple example of archiving a folder using truezip - but I couldn't find anything useful - I need a simple example of how to archive a given folder .

I'm using Java 6. How to archive a folder in Java using truezip?

EDIT: Also found this example .

Using TrueZIP, all you need to call is

new TFile("folder").cp_rp(new TFile("archive.zip"));

I suggest to read it's tutorial in order to get a better understanding of what it all means: TrueZIP Tutorial

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM