public class SevenZExtractor extends Object implements Extractor, RandomAccess
Constructor and Description |
---|
SevenZExtractor(File file)
构造
|
SevenZExtractor(File file,
char[] password)
构造
|
SevenZExtractor(InputStream in)
构造
|
SevenZExtractor(InputStream in,
char[] password)
构造
|
SevenZExtractor(SeekableByteChannel channel)
构造
|
SevenZExtractor(SeekableByteChannel channel,
char[] password)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
close()
无异常关闭
|
void |
extract(File targetDir,
int stripComponents,
Filter<org.apache.commons.compress.archivers.ArchiveEntry> filter)
释放(解压)到指定目录,结束后自动关闭流,此方法只能调用一次
|
InputStream |
get(String entryName)
获取指定名称的文件流
|
InputStream |
getFirst(Filter<org.apache.commons.compress.archivers.ArchiveEntry> filter)
获取满足指定过滤要求的压缩包内的第一个文件流
|
public SevenZExtractor(File file)
file
- 包文件public SevenZExtractor(File file, char[] password)
file
- 包文件password
- 密码,null表示无密码public SevenZExtractor(InputStream in)
in
- 包流public SevenZExtractor(InputStream in, char[] password)
in
- 包流password
- 密码,null表示无密码public SevenZExtractor(SeekableByteChannel channel)
channel
- SeekableByteChannel
public SevenZExtractor(SeekableByteChannel channel, char[] password)
channel
- SeekableByteChannel
password
- 密码,null表示无密码public void extract(File targetDir, int stripComponents, Filter<org.apache.commons.compress.archivers.ArchiveEntry> filter)
extract
in interface Extractor
targetDir
- 目标目录filter
- 解压文件过滤器,用于指定需要释放的文件,null表示不过滤。当Filter.accept(Object)
为true时释放。stripComponents
- 清除(剥离)压缩包里面的 n 级文件夹名public InputStream getFirst(Filter<org.apache.commons.compress.archivers.ArchiveEntry> filter)
filter
- 用于指定需要释放的文件,null表示不过滤。当Filter.accept(Object)
为true时返回对应流。null
public InputStream get(String entryName)
entryName
- entry名称null
Copyright © 2024. All rights reserved.