- String ext = ".info";
- for (File dir : baseDir.listFiles()) {
- if (dir.isDirectory()) {
- for (File file : dir.listFiles()) {
+ File[] dirs = baseDir.listFiles(new FileFilter() {
+ public boolean accept(File file) {
+ return file != null && file.isDirectory();
+ }
+ });
+
+ Progress pgDirs = new Progress(0, 100 * dirs.length);
+ pg.addProgress(pgDirs, 100);
+
+ final String ext = ".info";
+ for (File dir : dirs) {
+ File[] files = dir.listFiles(new FileFilter() {
+ public boolean accept(File file) {
+ return file != null
+ && file.getPath().toLowerCase().endsWith(ext);
+ }
+ });
+
+ Progress pgFiles = new Progress(0, files.length);
+ pgDirs.addProgress(pgFiles, 100);
+ pgDirs.setName("Loading from: " + dir.getName());
+
+ for (File file : files) {
+ try {
+ pgFiles.setName(file.getName());
+ MetaData meta = InfoReader.readMeta(file);