mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
Merge pull request #3674 from zdu-strong/v6-dev-compress-util
CompressUtil automatically decompress tgz and tar.gz files
This commit is contained in:
commit
72ac17e41e
@ -183,6 +183,11 @@ public class CompressUtil {
|
||||
return new SevenZExtractor(file);
|
||||
}
|
||||
try {
|
||||
if (StrUtil.isBlank(archiverName) && file.getName().toLowerCase().endsWith(".tgz")) {
|
||||
archiverName = "tgz";
|
||||
} else if (StrUtil.isBlank(archiverName) && file.getName().toLowerCase().endsWith(".tar.gz")) {
|
||||
archiverName = "tar.gz";
|
||||
}
|
||||
return new StreamExtractor(charset, archiverName, file);
|
||||
} catch (final CompressException e) {
|
||||
final Throwable cause = e.getCause();
|
||||
|
Loading…
x
Reference in New Issue
Block a user