폴더, 파일찾기 수정
This commit is contained in:
@@ -306,13 +306,15 @@ public class FIleChecker {
|
||||
// int fileTotCnt = 0;
|
||||
// long fileTotSize = 0;
|
||||
|
||||
Predicate<Path> isTarget = p -> {
|
||||
if (targetFileNm == null || targetFileNm.trim().isEmpty() || targetFileNm.trim().equals("*") ) {
|
||||
return true; // 전체 파일 허용
|
||||
}
|
||||
return p.getFileName().toString().contains(targetFileNm);
|
||||
};
|
||||
|
||||
Predicate<Path> isTarget =
|
||||
p -> {
|
||||
if (targetFileNm == null
|
||||
|| targetFileNm.trim().isEmpty()
|
||||
|| targetFileNm.trim().equals("*")) {
|
||||
return true; // 전체 파일 허용
|
||||
}
|
||||
return p.getFileName().toString().contains(targetFileNm);
|
||||
};
|
||||
|
||||
try (Stream<Path> stream = Files.walk(startPath, maxDepth)) {
|
||||
|
||||
@@ -358,7 +360,7 @@ public class FIleChecker {
|
||||
public static Long getFileTotSize(List<FIleChecker.Basic> files) {
|
||||
|
||||
Long fileTotSize = 0L;
|
||||
if( files != null || files.size() > 0 ) {
|
||||
if (files != null || files.size() > 0) {
|
||||
fileTotSize = files.stream().mapToLong(FIleChecker.Basic::getFileSize).sum();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user