2

我想在提取 zip 时忽略隐藏文件。有什么方法可以识别 ZipEntry 属于“隐藏”文件吗?

4

2 回答 2

2

If this is on Windows, there is no way to do it. The ZipEntry doesn't contain such information. You might be able to write your own zipper to store the information in ExtraInfo field.

On Unix, you can workaround by checking the leading dot in the filename.

于 2010-06-02T13:37:46.417 回答
2

http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#isHidden%28%29

他们在创建 zip 时应该保留它。

于 2010-06-02T13:19:24.563 回答