Package org.miaixz.bus.core.io.compress
Class ZipFileResource
java.lang.Object
org.miaixz.bus.core.io.compress.ZipFileResource
- All Implemented Interfaces:
Closeable,AutoCloseable,ZipResource
ZipFile 资源包装- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ZipFileResource
构造- Parameters:
zipFile-ZipFile
-
-
Method Details
-
read
Description copied from interface:ZipResource读取并处理Zip文件中的每一个ZipEntry- Specified by:
readin interfaceZipResource- Parameters:
consumer-ZipEntry处理器maxSizeDiff- 检查ZipBomb文件差异倍数,-1表示不检查ZipBomb
-
get
Description copied from interface:ZipResource获取指定路径的文件流 如果是文件模式,则直接获取Entry对应的流,如果是流模式,则遍历entry后,找到对应流返回- Specified by:
getin interfaceZipResource- Parameters:
path- 路径- Returns:
- 文件流
-
get
Description copied from interface:ZipResource获取指定ZipEntry对应的文件流- Specified by:
getin interfaceZipResource- Parameters:
entry-ZipEntry- Returns:
- 文件流
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-