remove concole

This commit is contained in:
Looly 2020-05-30 08:20:43 +08:00
parent b8f8a3277f
commit 32ece1bbf4
3 changed files with 25 additions and 3 deletions

View File

@ -1151,6 +1151,30 @@ public class FileUtil {
}
}
/**
* 修改文件或目录的文件名不变更路径只是简单修改文件名<br>
* 重命名有两种模式<br>
* 1isRetainExt为true时保留原扩展名
*
* <pre>
* FileUtil.rename(file, "aaa", true) xx/xx.png =xx/aaa.png
* </pre>
* <p>
*
* <pre>
* FileUtil.rename(file, "aaa.jpg", false) xx/xx.png =xx/aaa.jpg
* </pre>
*
* @param file 被修改的文件
* @param newName 新的文件名包括扩展名
* @param isOverride 是否覆盖目标文件
* @return 目标文件
* @since 5.3.6
*/
public static File rename(File file, String newName, boolean isOverride) {
return rename(file, newName, false, isOverride);
}
/**
* 修改文件或目录的文件名不变更路径只是简单修改文件名<br>
* 重命名有两种模式<br>

View File

@ -70,7 +70,7 @@ public class FileUtilTest {
@Test
@Ignore
public void renameTest() {
FileUtil.rename(FileUtil.file("hutool.jpg"), "b.png", false, false);
FileUtil.rename(FileUtil.file("d:/test/3.jpg"), "2.jpg", false);
}
@Test

View File

@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.IterUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.Console;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@ -240,7 +239,6 @@ public class ExcelReader extends ExcelBase<ExcelReader> {
List rowList;
for (int i = startRowIndex; i <= endRowIndex; i++) {
rowList = readRow(i);
Console.log("### {}: {}", i, rowList);
if (CollUtil.isNotEmpty(rowList) || false == ignoreEmptyRow) {
if (null == rowList) {
rowList = new ArrayList<>(0);