This commit is contained in:
Looly
2022-06-16 12:10:56 +08:00
parent 4c7ac0042c
commit 60dd7ce563
5 changed files with 23 additions and 2 deletions

View File

@@ -59,7 +59,8 @@ public class StreamExtractor implements Extractor{
}
/**
* 构造
* 构造<br>
* 如果抛出异常,则提供的流将被关闭
*
* @param charset 编码
* @param archiverName 归档包格式null表示自动检测
@@ -75,6 +76,8 @@ public class StreamExtractor implements Extractor{
this.in = factory.createArchiveInputStream(archiverName, in);
}
} catch (ArchiveException e) {
// issue#2384如果报错可能持有文件句柄导致无法删除文件
IoUtil.close(in);
throw new CompressException(e);
}
}