parent
4b5d9f84fb
commit
41f4334b74
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,7 +57,7 @@ public class PasteContent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加异常
|
* 添加异常
|
||||||
*
|
*
|
||||||
* @param e
|
* @param e
|
||||||
* 异常
|
* 异常
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue