mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix code
This commit is contained in:
parent
e4f713a162
commit
477657ffb8
@ -6,6 +6,7 @@
|
||||
# 5.8.0.M3 (2022-04-10)
|
||||
|
||||
### ❌不兼容特性
|
||||
* 【core 】 StreamProgress#progress方法参数变更为2个(pr#594@Gitee)
|
||||
|
||||
### 🐣新特性
|
||||
* 【core 】 CopyOptions支持以Lambda方式设置忽略属性列表(pr#590@Gitee)
|
||||
|
@ -1,7 +1,9 @@
|
||||
package cn.hutool.core.io;
|
||||
|
||||
/**
|
||||
* Stream进度条
|
||||
* Stream进度条<br>
|
||||
* 提供流拷贝进度监测,如开始、结束触发,以及进度回调。<br>
|
||||
* 注意进度回调的{@code total}参数为总大小,某些场景下无总大小的标记,则此值应为-1或者{@link Long#MAX_VALUE},表示此参数无效。
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
@ -15,9 +17,10 @@ public interface StreamProgress {
|
||||
/**
|
||||
* 进行中
|
||||
*
|
||||
* @param total 总大小,如果未知为 -1或者{@link Long#MAX_VALUE}
|
||||
* @param progressSize 已经进行的大小
|
||||
*/
|
||||
void progress(long contentLength, long progressSize);
|
||||
void progress(long total, long progressSize);
|
||||
|
||||
/**
|
||||
* 结束
|
||||
|
@ -11,14 +11,14 @@ import cn.hutool.core.thread.ThreadUtil;
|
||||
*
|
||||
*/
|
||||
public class ConsoleTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void logTest(){
|
||||
Console.log();
|
||||
|
||||
|
||||
String[] a = {"abc", "bcd", "def"};
|
||||
Console.log(a);
|
||||
|
||||
|
||||
Console.log("This is Console log for {}.", "test");
|
||||
}
|
||||
|
||||
@ -27,12 +27,12 @@ public class ConsoleTest {
|
||||
Console.log("a", "b", "c");
|
||||
Console.log((Object) "a", "b", "c");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void printTest(){
|
||||
String[] a = {"abc", "bcd", "def"};
|
||||
Console.print(a);
|
||||
|
||||
|
||||
Console.log("This is Console print for {}.", "test");
|
||||
}
|
||||
|
||||
@ -41,14 +41,14 @@ public class ConsoleTest {
|
||||
Console.print("a", "b", "c");
|
||||
Console.print((Object) "a", "b", "c");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void errorTest(){
|
||||
Console.error();
|
||||
|
||||
|
||||
String[] a = {"abc", "bcd", "def"};
|
||||
Console.error(a);
|
||||
|
||||
|
||||
Console.error("This is Console error for {}.", "test");
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class ConsoleTest {
|
||||
Console.error("a", "b", "c");
|
||||
Console.error((Object) "a", "b", "c");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void inputTest() {
|
||||
@ -65,7 +65,7 @@ public class ConsoleTest {
|
||||
String input = Console.input();
|
||||
Console.log(input);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void printProgressTest() {
|
||||
|
@ -44,7 +44,7 @@ public class DownloadTest {
|
||||
@Ignore
|
||||
public void downloadTest() {
|
||||
// 带进度显示的文件下载
|
||||
HttpUtil.downloadFile("http://mirrors.sohu.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso", FileUtil.file("d:/"), new StreamProgress() {
|
||||
HttpUtil.downloadFile("http://mirrors.sohu.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-2009.iso", FileUtil.file("d:/"), new StreamProgress() {
|
||||
|
||||
final long time = System.currentTimeMillis();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user