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

Signed-off-by: 502647092 <admin@yumc.pw>
merge/1/MERGE
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;
}
/**
* @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.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
@ -31,7 +32,7 @@ public class PasteContent {
if (file == null) {
throw new IllegalArgumentException("文件不得为Null!");
}
addLines(Files.readAllLines(file.toPath()));
addLines(Files.readAllLines(file.toPath(), Charset.forName("UTF-8")));
}
/**
@ -56,7 +57,7 @@ public class PasteContent {
/**
*
*
*
* @param e
*
*/