mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -9,6 +9,9 @@ import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -188,4 +191,15 @@ public class DownloadTest {
|
||||
FileUtil.del(file1);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
//@Ignore
|
||||
public void downloadTeamViewerTest() throws IOException {
|
||||
// 此URL有3次重定向, 需要请求4次
|
||||
final String url = "https://download.teamviewer.com/download/TeamViewer_Setup_x64.exe";
|
||||
HttpGlobalConfig.setMaxRedirectCount(20);
|
||||
final Path temp = Files.createTempFile("tmp", ".exe");
|
||||
final File file = HttpUtil.downloadFileFromUrl(url, temp.toFile());
|
||||
Console.log(file.length());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user