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