mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
FileUtil增加readLines重载,支持filter
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user