开发者

How can I extract all multi-part ZIP/RAR archives in a directory?

I need to extract all the multi-part ZIP and RAR archives in a given path? Does Java have any inbuilt methods for doing this? If not, would someone happen to know of a free library that does this?

Than开发者_JAVA百科ks.


  1. Loop all files in the directory - new File(dir).listFiles(), possibly using a FilenameFilter to retain only those whose extension is .zip

  2. You can use the java.util.zip package, or commons-compress. But my experience shows that using the ant Zip task programatically is way easier. (You'd need the ant jar on the classpath). This is for .zip files. For RAR you'd need another utility. Take a look at this question. The URL in the answer does not open, but the name of the project is valid - google it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜