mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
FileUtil增加readLines重载,支持filter
This commit is contained in:
parent
8395ca12b0
commit
7bed31e13f
@ -11,6 +11,7 @@
|
||||
* 【extra 】 优化SpringUtil在非Spring环境下的异常(issue#2835@Github)
|
||||
* 【core 】 StrUtil增加commonPrefix和commonSuffix方法(pr#3007@Github)
|
||||
* 【core 】 NumberUtil增加重载parseXXX方法, 解析失败返回默认值(pr#3007@Github)
|
||||
* 【core 】 FileUtil增加readLines重载,支持filter(pr#3006@Github)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【crypto】 修复NoSuchMethodError未捕获问题(issue#2966@Github)
|
||||
|
@ -2418,7 +2418,7 @@ public class FileUtil extends PathUtil {
|
||||
public static List<String> readLines(File file, Charset charset, Predicate<String> filter) throws IORuntimeException {
|
||||
final List<String> result = new ArrayList<>();
|
||||
readLines(file, charset, (LineHandler) line -> {
|
||||
if (Boolean.TRUE.equals(filter.test(line))) {
|
||||
if (filter.test(line)) {
|
||||
result.add(line);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user