Checks for files that are known to indicate root.
@return - list of such files found
347204
private List<String> existingRootFiles() {
        List<String> filesFound = new ArrayList<>();
        for (String path : SU_PATHS) {
            if (new File(path).exists()) {
                filesFound.add(path);
            }
        }
        return filesFound;
    }
766004
def discover_files(base_path, sub_path='', ext='', trim_base_path=False):
    """"""
    file_list = []
    for root, dirs, files in walk(path.join(base_path, sub_path)):
        if trim_base_path:
            root = path.relpath(root, base_path)
        file_list.extend([path.join(root, file_name)
                          for file_name in files
                          if file_name.endswith(ext)])
    return sorted(file_list)
618489
public function rootDirExists()
    {
        $path = $this->getRootDir();
        return !empty($path) && @file_exists($path) && @is_dir($path);
    }
880361
def _find_files(self):
        
        files = []
        for ext in self.extensions:
            ext_files = util.find_files(self.root, "*" + ext)
            log.debug("found {} '*{}' files in '{}'".format(
                len(ext_files), ext, self.root)
            )
            files.extend(ext_files)
        return files
207937
def _get_root_files(self, directory):
        """"""
        if len(self.filepaths) is 0:
            if self.filters:
                root_files = [(directory, f) for f in os.listdir(directory)
                              if os.path.isfile(os.path.join(directory, f))
                              and self.filters.validate(f)
                              and self.filters.get_level(f) == self.filters.max_level]
            else:
                root_files = [(directory, f) for f in os.listdir(directory)
                              if os.path.isfile(os.path.join(directory, f))]
            self.add_path(root_files)
309742
def find_file_paths(self):
        
        paths = []
        for root, dirs, files in os.walk(self.directory, topdown=True):
            rel_path = os.path.relpath(root, self.directory)
            for f in files:
                if rel_path == '.':
                    path = (f, os.path.join(root, f))
                else:
                    path = (os.path.join(rel_path, f), os.path.join(root, f))
                paths.append(path)
        return paths
1302423
public boolean directoryContainsFiles(File fileDir)
    {
        boolean containsFiles = false;
        File[] files = fileDir.listFiles();
        if (files != null)
        {
            for (File file : files)
            {
                if (!file.isDirectory())
                    containsFiles = true;
            }
        }
        return containsFiles;
    }
1189177
public static List<File> getDirectories(File root) {
        if (root == null)
            return Collections.emptyList();

        FileFilter filter = new DirsOnlyFilter();

        File fileList[] = root.listFiles(filter);

        if (fileList == null)
            return Collections.emptyList();
        else
            return Arrays.asList(fileList);
    }
1217774
def find_files_relative(directory, files)
      return [] unless files.any?
      files.each_with_object([]) do |file, obj|
        path = "#{directory}/#{file}"
        obj << path if File.exist?(path)
      end
    end
1301198
private void scanForUnknownDirectories() {
      File[] filesInRoot = rootDirectory.listFiles();
      if (filesInRoot != null) {
         for (File maybeDirectory : filesInRoot) {
            if (maybeDirectory.isDirectory()) {
               String name = maybeDirectory.getName();
               try {
                  getDirectory(name);
               }
               catch (PersistenceException e) {
                  log.couldNotWalkDirectory(name, e);
               }
            }
         }
      }
   }
427601
def __find_source_files(self):
        
        for dir_path, _, files in os.walk(self._source_directory):
            for name in files:
                if name.lower().endswith(self._source_file_extension):
                    basename = os.path.splitext(os.path.basename(name))[0]
                    relative_path = os.path.relpath(os.path.join(dir_path, name))

                    if basename in self._source_file_names:
                        self._io.error("Files '{0}' and '{1}' have the same basename.".
                                       format(self._source_file_names[basename], relative_path))
                        self.error_file_names.add(relative_path)
                    else:
                        self._source_file_names[basename] = relative_path
392609
List<File> getFiles() {
        List<File> list = new ArrayList<File>();
        for (String sDirectory : config.getDirectories()) {
            if (sDirectory != null) {
                File directory = getDirectory(sDirectory);
                File[] aFiles = directory.listFiles(config.getFilenameFilter());
                if (aFiles != null) {
                    list.addAll(Arrays.asList(aFiles));
                }
            }
        }
        return list;
    }
216369
def get_file_list(self):
        
        if os.path.isdir(self.root_path):
            return [os.path.join(self.root_path, f) for f in os.listdir(self.root_path)
                    if os.path.isfile(os.path.join(self.root_path, f))]
        else:
            return [self.root_path]
587296
@Override @Deprecated
  public FileStatus[] getCorruptFiles() throws IOException {
    CorruptFileBlocks corruptFileBlocks = listCorruptFileBlocks("/", null);
    Set<String> filePaths = new HashSet<String>();
    for (String file : corruptFileBlocks.getFiles()) {
      filePaths.add(file);
    }

    List<FileStatus> fileStatuses = new ArrayList<FileStatus>(filePaths.size());
    for (String f: filePaths) {
      FileStatus fs = getFileInfo(f);
      if (fs != null)
        LOG.info("found fs for " + f);
      else
        LOG.info("found no fs for " + f);
      fileStatuses.add(fs);
    }
    return fileStatuses.toArray(new FileStatus[fileStatuses.size()]);
  }
1289384
public IntList getRoots() {
    IntList roots = new IntArrayList();
    for(int i = 0; i < used; i++) {
      // roots or one element in component
      if(parent[i] == i) {
        roots.add(i);
      }
    }
    return roots;
  }
280807
protected String[] getFilesystemRoots() throws IOException {
		File[] fileRoots=File.listRoots();
		List<String> tempRoots=new ArrayList<>(fileRoots.length);
		for (File fileRoot : fileRoots) {
			String root = fileRoot.getPath();
			// Only add if this root is used for at least one backup setting
			FilesystemIteratorRule defaultRule = rules.get("");
			if(
				(defaultRule!=null && defaultRule.isIncluded(root))
				|| hasIncludedChild(root)
			) tempRoots.add(root);
		}
		return tempRoots.toArray(new String[tempRoots.size()]);
	}
95362
private List<INode> getLeaves() {
    List<INode> leaveDirs = new ArrayList<INode>();
    root.getLeaves(leaveDirs);
    return leaveDirs;
  }