test/java/io/pathNames/General.java
Print this page
*** 125,137 ****
if (dl == null) {
throw new RuntimeException("Can't list " + dir);
}
for (int i = 0; i < dl.length; i++) {
File f = new File(d, dl[i]);
! if (f.isDirectory() && f.canRead()) {
String[] dl2 = f.list();
! if (dl2.length >= 250) {
/* Heuristic to avoid scanning huge directories */
continue;
}
return dl[i];
}
--- 125,137 ----
if (dl == null) {
throw new RuntimeException("Can't list " + dir);
}
for (int i = 0; i < dl.length; i++) {
File f = new File(d, dl[i]);
! if (f.isDirectory()) {
String[] dl2 = f.list();
! if (dl2 == null || dl2.length >= 250) {
/* Heuristic to avoid scanning huge directories */
continue;
}
return dl[i];
}