Exemplo n.º 1
0
  private FileNaming rescanChild(
      final FileNaming folderName, final String childName, boolean ignoreCache) {
    final File folder = folderName.getFile();
    final File child = new File(folder, childName);
    final FileInfo fInfo = new FileInfo(child);

    FileNaming retval =
        (fInfo.isConvertibleToFileObject())
            ? NamingFactory.fromFile(folderName, child, ignoreCache)
            : null;
    if (retval != null) {
      addChild(folderName, retval);
    } else {
      FileName fChild =
          new FileName(folderName, child, null) {
            @Override
            public boolean isDirectory() {
              return false;
            }

            @Override
            public boolean isFile() {
              return false;
            }
          };

      removeChild(folderName, fChild);
    }

    return retval;
  }
Exemplo n.º 2
0
 @Override
 public void run() {
   final File[] children = folder.listFiles();
   if (children != null) {
     newChildren = new LinkedHashSet<FileNaming>();
     for (int i = 0; i < children.length; i++) {
       final FileInfo fInfo = new FileInfo(children[i], 1);
       if (fInfo.isConvertibleToFileObject()) {
         FileNaming child = NamingFactory.fromFile(folderName, children[i], ignoreCache);
         newChildren.add(child);
       }
     }
   } else {
     folderExists = folder.exists();
     // #150009 - children == null -> folder does not exists, or an I/O error occurs
     // folder.listFiles() failed with I/O exception - do not remove children
   }
 }