Find all types within an index
@param root dir within the classpath
@param subdir subdir name
@return A list of found JSON files
@deprecated Sounds like it's not used. We will remove it
@throws IOException if something goes wrong
979380
@Deprecated
	protected static ArrayList<String> findJsonFiles(Path root, String subdir) throws IOException {
		logger.debug("Looking for json files in classpath under [{}/{}].", root, subdir);

		final ArrayList<String> jsonFiles = new ArrayList<>();
		final Path indexDir = root.resolve(subdir);
		if (Files.exists(indexDir)) {
			Files.walkFileTree(indexDir, new SimpleFileVisitor<Path>() {
				@Override
				public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
					// We have now files. They could be type, settings, templates...
					String jsonFile = indexDir.relativize(file).toString();

					if (jsonFile.equals(Defaults.IndexSettingsFileName) ||
							jsonFile.equals(Defaults.UpdateIndexSettingsFileName)) {
						logger.trace("ignoring: [{}]", jsonFile);
						return CONTINUE;
					}
					jsonFile = jsonFile.substring(0, jsonFile.lastIndexOf(Defaults.JsonFileExtension));

					jsonFiles.add(jsonFile);
					logger.trace("json found: [{}]", jsonFile);
					return CONTINUE;
				}
			});
		} else {
			logger.trace("[{}] does not exist in [{}].", subdir, root);
		}

		return jsonFiles;
	}
167085
public static List<File> findFiles(final String start, final String[] extensions)
	{
		final List<File> files = new ArrayList<>();
		final Stack<File> dirs = new Stack<>();
		final File startdir = new File(start);
		if (startdir.isDirectory())
		{
			dirs.push(new File(start));
		}
		while (dirs.size() > 0)
		{
			final File dirFiles = dirs.pop();
			final String s[] = dirFiles.list();
			if (s != null)
			{
				for (final String element : s)
				{
					final File file = new File(
						dirFiles.getAbsolutePath() + File.separator + element);
					if (file.isDirectory())
					{
						dirs.push(file);
					}
					else if (match(element, extensions))
					{
						files.add(file);
					}
				}
			}
		}
		return files;
	}
421552
def ids(type)

      Dir[File.join(dir_for(type), '**', '*.json')].collect { |path|
        File.basename(path, '.json')
      }.sort
    end
639660
private void listDirectory(File directory,
                               RelativeDirectory subdirectory,
                               Set<JavaFileObject.Kind> fileKinds,
                               boolean recurse,
                               ListBuffer<JavaFileObject> resultList) {
        File d = subdirectory.getFile(directory);
        if (!caseMapCheck(d, subdirectory))
            return;

        File[] files = d.listFiles();
        if (files == null)
            return;

        if (sortFiles != null)
            Arrays.sort(files, sortFiles);

        for (File f: files) {
            String fname = f.getName();
            if (f.isDirectory()) {
                if (recurse && SourceVersion.isIdentifier(fname)) {
                    listDirectory(directory,
                                  new RelativeDirectory(subdirectory, fname),
                                  fileKinds,
                                  recurse,
                                  resultList);
                }
            } else {
                if (isValidFile(fname, fileKinds)) {
                    JavaFileObject fe =
                        new RegularFileObject(this, fname, new File(d, fname));
                    resultList.append(fe);
                }
            }
        }
    }
261436
public static List<File> listFiles(File dir, FileFilter filter, boolean recursive){
		List<File> list = new ArrayList<File>();
		listFilesInternal(list, dir, filter, recursive);
		return list;
	}
881874
public List<T> find(String... includes) throws IOException {
        return find(getWorld().filter().include(includes));
    }
1083523
def find_subdirectories(basepath):
    '''
    
    '''
    directories = []
    for root, dirnames, filenames in os.walk(basepath):
        new_directories = [d for d in dirnames if d not in directories]
        directories = directories + new_directories
    return directories
589161
public static List<File> listFile(File rootDir) {
		return Files.fileTreeTraverser().preOrderTraversal(rootDir).filter(Files.isFile()).toList();
	}
846162
public static List<File> listAll(File rootDir) {
		return Files.fileTreeTraverser().preOrderTraversal(rootDir).toList();
	}
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()]);
	}
305823
private static Set<File> findAllFiles(File dir) {
        Set<File> foundFiles = new HashSet<>();
        if (dir == null) {
            return foundFiles;
        }
        recurse(dir, foundFiles);
        return foundFiles;
    }
1002938
public static List<File> listFiles(File[] directories, IOFileFilter fileFilter, IOFileFilter dirFilter) {
        List<File> files = new ArrayList<>();
        for (File directory : directories) {
            if (!directory.isDirectory()) {
                continue;
            }
            Collection<File> filesInDirectory = FileUtils.listFiles(directory,
                    fileFilter,
                    dirFilter);
            files.addAll(filesInDirectory);
        }
        return files;
    }
421562
public void indexSourceTree(final Folder rootFolder) {

		logger.info("Starting indexing of source tree " + rootFolder.getPath());

		final SecurityContext securityContext = rootFolder.getSecurityContext();
		app = StructrApp.getInstance(securityContext);

		structrTypeSolver.parseRoot(rootFolder);

		final CombinedTypeSolver typeSolver = new CombinedTypeSolver();
		typeSolver.add(new ReflectionTypeSolver());
		typeSolver.add(structrTypeSolver);

		facade = JavaParserFacade.get(typeSolver);

		logger.info("Done with indexing of source tree " + rootFolder.getPath());
	}
633300
public static List<File> findFilesWithFilter(final File dir, final String... extension)
	{
		final List<File> foundedFileList = new ArrayList<>();
		final File[] children = dir.listFiles(new MultiplyExtensionsFileFilter(true, extension));
		for (final File element : children)
		{
			// if the entry is a directory
			if (element.isDirectory())
			{ // then
				// find recursively in the directory and put it in a List.
				// Put the founded files in the main List.
				foundedFileList.addAll(findFilesWithFilter(element, extension));
			}
			else
			{
				foundedFileList.add(element.getAbsoluteFile());
			}
		}
		return foundedFileList;
	}
1301410
private List<String> listFiles( final File dir, final String parentName )
    {
        final List<String> fileNames = new ArrayList<String>();
        File[] files = null;
        if( dir.canRead() )
        {
            files = dir.listFiles();
        }
        if( files != null )
        {
            for( File file : files )
            {
                if( file.isDirectory() )
                {
                    fileNames.addAll( listFiles( file, parentName + file.getName() + "/" ) );
                }
                else
                {
                    fileNames.add( parentName + file.getName() );
                }
            }
        }
        return fileNames;
    }
965732
public static Collection<String> listFiles(ClassLoader classLoader, String rootPath) {
    return listResources(classLoader, rootPath, path -> !StringUtils.endsWith(path, "/"));
  }
463312
static Collection<Path> findFiles(Path dir) {
		return toPaths(dir.toFile().listFiles((FileFilter) FileFileFilter.FILE));
	}