/** * Scan all files below the given one for metadata files, adding them * to the given collection. */ private int scan(File file, MetaDataFilter filter, FileResource rsrc, Collection<File> metas, int scanned) throws IOException { if (scanned > SCAN_LIMIT) throw new IllegalStateException(_loc.get("too-many-files", String.valueOf(SCAN_LIMIT)).getMessage()); scanned++; if (filter == null) metas.add(file); else { rsrc.setFile(file); if (filter.matches(rsrc)) metas.add(file); else { File[] files = (File[]) AccessController .doPrivileged(J2DoPrivHelper.listFilesAction(file)); if (files != null) for (int i = 0; i < files.length; i++) scanned = scan(files[i], filter, rsrc, metas, scanned); } } return scanned; }
/** * Scan all files below the given one for metadata files, adding them * to the given collection. */ private int scan(File file, MetaDataFilter filter, FileResource rsrc, Collection metas, int scanned) throws IOException { if (scanned > SCAN_LIMIT) throw new IllegalStateException(_loc.get("too-many-files", String.valueOf(SCAN_LIMIT)).getMessage()); scanned++; if (filter == null) metas.add(file); else { rsrc.setFile(file); if (filter.matches(rsrc)) metas.add(file); else { File[] files = (File[]) AccessController .doPrivileged(J2DoPrivHelper.listFilesAction(file)); if (files != null) for (int i = 0; i < files.length; i++) scanned = scan(files[i], filter, rsrc, metas, scanned); } } return scanned; }
/** * Scan all files below the given one for metadata files, adding them * to the given collection. */ private int scan(File file, MetaDataFilter filter, FileResource rsrc, Collection<File> metas, int scanned) throws IOException { if (scanned > SCAN_LIMIT) throw new IllegalStateException(_loc.get("too-many-files", String.valueOf(SCAN_LIMIT)).getMessage()); scanned++; if (filter == null) metas.add(file); else { rsrc.setFile(file); if (filter.matches(rsrc)) metas.add(file); else { File[] files = (File[]) AccessController .doPrivileged(J2DoPrivHelper.listFilesAction(file)); if (files != null) for (int i = 0; i < files.length; i++) scanned = scan(files[i], filter, rsrc, metas, scanned); } } return scanned; }
/** * Scan all files below the given one for metadata files, adding them * to the given collection. */ private int scan(File file, MetaDataFilter filter, FileResource rsrc, Collection<File> metas, int scanned) throws IOException { if (scanned > SCAN_LIMIT) throw new IllegalStateException(_loc.get("too-many-files", String.valueOf(SCAN_LIMIT)).getMessage()); scanned++; if (filter == null) metas.add(file); else { rsrc.setFile(file); if (filter.matches(rsrc)) metas.add(file); else { File[] files = (File[]) AccessController .doPrivileged(J2DoPrivHelper.listFilesAction(file)); if (files != null) for (int i = 0; i < files.length; i++) scanned = scan(files[i], filter, rsrc, metas, scanned); } } return scanned; }