Esempio n. 1
0
 private boolean addRoot(String pathname, String filename, boolean listIt) {
   FileInfo dir = new FileInfo();
   dir.isDirectory = true;
   dir.pathname = pathname;
   dir.filename = filename;
   if (findRoot(pathname) != null) {
     log.w("skipping duplicate root " + pathname);
     return false; // exclude duplicates
   }
   if (listIt) {
     log.i("Checking FS root " + pathname);
     if (!dir.isReadableDirectory()) { // isWritableDirectory
       log.w("Skipping " + pathname + " - it's not a readable directory");
       return false;
     }
     if (!listDirectory(dir)) {
       log.w("Skipping " + pathname + " - listing failed");
       return false;
     }
     log.i("Adding FS root: " + pathname + "  " + filename);
   }
   mRoot.addDir(dir);
   dir.parent = mRoot;
   if (!listIt) {
     dir.isListed = true;
     dir.isScanned = true;
   }
   return true;
 }