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,
Predicate<org.apache.commons.compress.archivers.ArchiveEntry> predicate)
释放(解压)到指定目录,结束后自动关闭流,此方法只能调用一次
|
InputStream |
getFirst(Predicate<org.apache.commons.compress.archivers.ArchiveEntry> predicate)
获取满足指定过滤要求的压缩包内的第一个文件流
|
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 - SeekableByteChannelpublic SevenZExtractor(SeekableByteChannel channel, char[] password)
channel - SeekableByteChannelpassword - 密码,null表示无密码public void extract(File targetDir, Predicate<org.apache.commons.compress.archivers.ArchiveEntry> predicate)
Extractorextract in interface ExtractortargetDir - 目标目录predicate - 解压文件过滤器,用于指定需要释放的文件,null表示不过滤。Predicate.test(Object)为true时释放。public InputStream getFirst(Predicate<org.apache.commons.compress.archivers.ArchiveEntry> predicate)
ExtractorgetFirst in interface Extractorpredicate - 用于指定需要释放的文件,null表示不过滤。当Predicate.test(Object)为true返回对应流。nullCopyright © 2025. All rights reserved.