Example #1
0
 @Override
 public void run() {
   notifyFileCountObservers(CountType.TOTAL, FileUtility.fileCount(file, FILTER));
   try {
     ArrayList<File> files = new ArrayList<File>();
     files.add(file);
     while (!stop && !files.isEmpty()) {
       File file = files.remove(0);
       if (file.isDirectory()) files.addAll(Arrays.asList(file.listFiles(FILTER)));
       else processFile(file);
     }
     if (interuptCallerThread != null)
       synchronized (interuptCallerThread) {
         interuptCallerThread.notify();
       }
   } catch (IOException e) {
     e.printStackTrace();
   }
 }