从zip文件夹中检索文件

时间:2018-09-17 09:37:15

标签: java inputstream zipfile

我有一个zip文件结构。

MyZip.zip
    folder_1
        folder_1_1
            file_1_1_1
            file_1_1_2
        folder_1_2
            file_1_2_1
            file_1_2_2
    folder_2
        folder_2_1
            folder_2_1_1
                needed_file   //This is the file I need to read.

因此,我需要从needed_file内的folder_2_1_1文件夹中读取文件folder_2_1,依此类推。

这是GstMeta。我不需要解压缩存档。我的问题是,是否可以在不解压缩整个存档的情况下检索到我需要的文件。

我尝试了

ZipFile zipFile = new ZipFile(file);
ZipEntry entry = zipFile.getEntry("folder_2");

但是我没有找到一种方法来操纵zipEntry作为目录。

0 个答案:

没有答案