Java unzip – unzip multiple file or folder instances

Java decompression zip - multiple files (including folders), as follows:

Compress multiple files and folders and decompress complex file directories.

The compression method uses variable parameters and can compress 1 to multiple files You can write an array or write it to the parameter list one by one

Test file directory structure:

The compressed content of the test: English folder and two Excel files at the same level

Here is the compressed code:

During compression, judge the folder, and then compress the file recursively.

Then unzip:

When decompressing, judge to create a nonexistent folder for the folder. Only create the folder without decompressing Because the decompression is for files, not folders, folders need to be created by themselves.

Test method:

The test method does not handle any exceptions, which is wrong. Please do not imitate.

Output results:

abc/English/templete. Xls ABC / English / Chinese / CSDN / isea / 533 / ABC / templet Xls ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / templet Xls ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / zipfile / ABC / templet Xls ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / zipfile / ABC / zipfile2 / templet Xls ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / zipfile / ABC / zipfile2 / card collection list Xls ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / card collection list Xls ABC / English / Chinese / CSDN / isea / templet Xls ABC / English / Chinese / CSDN / isea / card receiving list Xls ABC / English / Chinese / CSDN / templet Xls ABC / English / card collection list Xls ABC / release data Xls ABC / Chinese name Xls ************************** compressed D: / zipfile / ABC / Chinese name Xls D: / zipfile / ABC / release data Xls D: / zipfile / ABC / English / card collection list Xls D: / zipfile / ABC / English / Chinese / CSDN / templet Xls D: / zipfile / ABC / English / Chinese / CSDN / isea / card receiving list Xls D: / zipfile / ABC / English / Chinese / CSDN / isea / templet Xls D: / zipfile / ABC / English / Chinese / CSDN / isea / 533 / ABC / templet xls d:/zipfile/abc/English/templete. Xls D: / zipfile / ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / templet Xls D: / zipfile / ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / zipfile / ABC / templet Xls D: / zipfile / ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / zipfile / ABC / zipfile2 / templet Xls D: / zipfile / ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / zipfile / ABC / zipfile2 / card collection list Xls D: / zipfile / ABC / English / Chinese / CSDN / isea / 533 / ABC / zipfile2 / card collection list Xls ****************** decompression completed********************

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>