ZipOutputStream中创建文件夹
时间: 2023-10-22 17:02:46 浏览: 232
创建文件夹
在ZipOutputStream中,可以通过创建ZipEntry来创建文件夹。具体步骤如下:
1. 使用new ZipEntry(String entryName)构造函数创建一个ZipEntry对象,其中entryName是文件夹的路径和名称。
2. 使用zipOutputStream.putNextEntry(entry)方法将此ZipEntry对象添加到压缩流中。
通过这样的方式,就可以在ZipOutputStream中成功创建一个文件夹。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [导出多个Excel表生成多级目录压缩包——ZipOutputStream+easypoi](https://blog.csdn.net/student_hwj/article/details/128313197)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Android实现文件或文件夹压缩成.zip格式压缩包](https://download.csdn.net/download/weixin_38714761/14881264)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文