mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
feat CompressUtil 新增 stripComponents 参数 #I67MIK
This commit is contained in:
@@ -6,11 +6,13 @@ import cn.hutool.extra.compress.extractor.Extractor;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ExtractorTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void zipTest(){
|
||||
public void zipTest() {
|
||||
Extractor extractor = CompressUtil.createExtractor(
|
||||
CharsetUtil.defaultCharset(),
|
||||
FileUtil.file("d:/test/c_1344112734760931330_20201230104703032.zip"));
|
||||
@@ -20,8 +22,8 @@ public class ExtractorTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void sevenZTest(){
|
||||
Extractor extractor = CompressUtil.createExtractor(
|
||||
public void sevenZTest() {
|
||||
Extractor extractor = CompressUtil.createExtractor(
|
||||
CharsetUtil.defaultCharset(),
|
||||
FileUtil.file("d:/test/compress/test.7z"));
|
||||
|
||||
@@ -30,12 +32,38 @@ public class ExtractorTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void tgzTest(){
|
||||
Extractor extractor = CompressUtil.createExtractor(
|
||||
public void tgzTest() {
|
||||
Extractor extractor = CompressUtil.createExtractor(
|
||||
CharsetUtil.defaultCharset(),
|
||||
"tgz",
|
||||
FileUtil.file("d:/test/test.tgz"));
|
||||
|
||||
extractor.extract(FileUtil.file("d:/test/tgz/"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void sevenZTest2() {
|
||||
File targetDir = FileUtil.file("d:/test/sevenZ2/");
|
||||
FileUtil.clean(targetDir);
|
||||
//
|
||||
Extractor extractor = CompressUtil.createExtractor(
|
||||
CharsetUtil.defaultCharset(),
|
||||
FileUtil.file("D:/System-Data/Downloads/apache-tomcat-10.0.27.7z"));
|
||||
|
||||
extractor.extract(targetDir, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void zipTest2() {
|
||||
File targetDir = FileUtil.file("d:/test/zip2/");
|
||||
FileUtil.clean(targetDir);
|
||||
//
|
||||
Extractor extractor = CompressUtil.createExtractor(
|
||||
CharsetUtil.defaultCharset(),
|
||||
FileUtil.file("D:/System-Data/Downloads/apache-tomcat-10.0.27.zip"));
|
||||
|
||||
extractor.extract(targetDir, 1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user