1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-11-22 01:48:50 +00:00

feat: 新增StrKit方法 修复文本读取错误

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-09-20 01:49:05 +08:00
parent 4b5d9f84fb
commit 41f4334b74
2 changed files with 21 additions and 2 deletions

View File

@ -28,4 +28,22 @@ public class StrKit {
} }
return ret; return ret;
} }
/**
* @param str
* 字串
* @return 是否为空字串
*/
public static boolean isBlank(final String str) {
return str == null || str.isEmpty();
}
/**
* @param str
* 字串
* @return 是否不为空字串
*/
public static boolean notBlank(final String str) {
return str != null && !str.isEmpty();
}
} }

View File

@ -2,6 +2,7 @@ package pw.yumc.YumCore.paste;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files; import java.nio.file.Files;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -31,7 +32,7 @@ public class PasteContent {
if (file == null) { if (file == null) {
throw new IllegalArgumentException("文件不得为Null!"); throw new IllegalArgumentException("文件不得为Null!");
} }
addLines(Files.readAllLines(file.toPath())); addLines(Files.readAllLines(file.toPath(), Charset.forName("UTF-8")));
} }
/** /**