Gets the list of HBase Common Avro schema strings from dir. It recursively
searches dir to find files that end in .avsc to locate those strings.

@param dir
The dir to recursively search for schema strings
@return The list of schema strings
357592
private List<String> getSchemaStringsFromDir(File dir) {
    List<String> schemaStrings = new ArrayList<String>();
    Collection<File> schemaFiles = FileUtils.listFiles(dir,
        new SuffixFileFilter(".avsc"), TrueFileFilter.INSTANCE);
    for (File schemaFile : schemaFiles) {
      schemaStrings.add(getSchemaStringFromFile(schemaFile));
    }
    return schemaStrings;
  }
768749
def _recursive_get_all_file_names(dir):
    
    if not dir:
        return []

    result = []
    for basedir, dirs, files in os.walk(dir):
        result.extend(files)

    return result
71604
def recursively_get_files_from_directory(directory):
    
    return [
        os.path.join(root, filename)
        for root, directories, filenames in os.walk(directory)
        for filename in filenames
    ]
565717
public static File[] listExtensions(String extensionDir) {
    File[] extensions = new File(extensionDir)
        .listFiles(file -> file.getPath().toLowerCase().endsWith(Constants.EXTENSION_JAR));
    if (extensions == null) {
      // Directory does not exist
      return EMPTY_EXTENSIONS_LIST;
    }
    return extensions;
  }
1119920
private static HashSet<String> searchDirectoryForPattern(File dir,String A, String B) 
        throws Exception {
        
        File[] files = dir.listFiles();

        HashSet<String> pattern_set = new HashSet<String>();

        for (int i = 0; i < files.length; i++) {
            File f = files[i];
            if (f.isDirectory()) {
                pattern_set.addAll(searchDirectoryForPattern(f, A, B));
            } else if (f.getName().endsWith(".txt")) {
                Scanner sc = new Scanner(f);
                while (sc.hasNext()) {
                    if (A.equals(sc.next())) {
                        String pattern = "";
                        int count = 0;
                        while (count <= MAX_INTER && sc.hasNext()) { 
                            String curr = sc.next();
                            if (count >= MIN_INTER && B.equals(curr)) {
                                //add the String onto a Set of Strings containing the patterns
                                //System.err.println("adding pattern: " + pattern);
                                pattern_set.add(pattern);
                                break;
                                /*
                                for (int j = 0; j < count; j++) {
                                    System.err.print(pattern[j] + " ");
                                }
                                    System.err.print("\n");
                                */
                            } else {
                                if (count > 0) {
                                    pattern += " ";
                                }
                                pattern += curr;
                                count++;
                            }
                        }
                    }
                }
            }
        }
        return pattern_set;
    }
851732
public static boolean deleteDirectoryTree( File dir )
    {
        File[] files = dir.listFiles();
        if (files == null) files = new File[0];
        for (File file : files)
        {
            deleteDirectoryTree( file );
        }
        return dir.delete();
    }
361142
protected static File findRawDir(File dir) {
		for (int i = 0; dir != null && i < 20; i++) {
			File rawDir = findResRawDir(dir);
			if (rawDir != null) {
				return rawDir;
			}
			dir = dir.getParentFile();
		}
		return null;
	}
724
private synchronized List<Entry> getEntriesList( DirectoryEntry directory )
    {
        List<Entry> entries = contents.get( directory );
        if ( entries == null )
        {
            entries = new ArrayList<Entry>();
            contents.put( directory, entries );
        }
        return entries;
    }
1329030
public static List<File> listDirs(final File dir)
	{
		final List<File> foundedDirs = new ArrayList<>();
		final File[] fileArray = dir.listFiles();
		for (final File element : fileArray)
		{
			if (element.isDirectory())
			{
				foundedDirs.add(element);
			}
		}
		return foundedDirs;

	}
1240487
public String[] getFileList()
    {
        String[] files = null;
        String strFilename = this.getProperty("filename");
        if (strFilename != null)
        {
            files = new String[1];
            files[0] = strFilename;
        }
        String strDirname = this.getProperty("folder");
        if (strDirname != null)
        {
            FileList list = new FileList(strDirname);
            files = list.getFileNames();
            if (!strDirname.endsWith("/"))
                strDirname += "/";
            for (int i = 0; i < files.length; i++)
            {
                files[i] = strDirname + files[i];   // Full pathname
            }
        }
        return files;
    }
1352859
@Override
  public Schema getSchema() {
    if (this.workUnit.contains(ConfigurationKeys.SOURCE_SCHEMA)) {
      return new Schema.Parser().parse(this.workUnit.getProp(ConfigurationKeys.SOURCE_SCHEMA));
    }

    AvroFsHelper hfsHelper = (AvroFsHelper) this.fsHelper;
    if (this.filesToPull.isEmpty()) {
      return null;
    }
    try {
      return hfsHelper.getAvroSchema(this.filesToPull.get(0));
    } catch (FileBasedHelperException e) {
      Throwables.propagate(e);
      return null;
    }
  }
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;
    }
1166632
public static ArrayList<File> getFilesInDirectoryTree(String path) {
		File directory = new File(path);
		return getContentsInDirectoryTree(directory, "*", true, false);
	}
305823
private static Set<File> findAllFiles(File dir) {
        Set<File> foundFiles = new HashSet<>();
        if (dir == null) {
            return foundFiles;
        }
        recurse(dir, foundFiles);
        return foundFiles;
    }
349381
public function getDeviceList($dir) {
        $path = array('.', '..', '.htaccess', '.DS_Store', 'controllers', 'config', 'debug', 'framework');
        $ext  = array("php", "html", "htm");
        $list = array();
        if (is_dir($dir)) {
            if ($handle = opendir($dir)) {
                while (($file = readdir($handle)) !== false) {
                    if (!in_array($file, $path) && !in_array(pathinfo($file, PATHINFO_EXTENSION), $ext)) {
                        $list[$file] = VENDOR_DIR . DS . FRAMEWORK . DS . $file;
                    }
                }
                closedir($handle);
            }
        }
        return $list;
    }
838031
public static Map<String,String> storeDirectoryResourcesAsString( File directory ) throws IOException {

		Map<String,byte[]> map = storeDirectoryResourcesAsBytes( directory );
		Map<String,String> result = new HashMap<>( map.size());
		for( Map.Entry<String,byte[]> entry : map.entrySet())
			result.put( entry.getKey(), new String( entry.getValue(), StandardCharsets.UTF_8 ));

		return result;
	}
409735
private List<File> getConfigFiles(File dir) {
		String[] extensions = { "xml" };
		List<File> configFiles = new ArrayList<File>();

		Collection<File> files = FileUtils.listFiles(dir, extensions, true);
		for (Iterator<File> iterator = files.iterator(); iterator.hasNext();) {
			File file = (File) iterator.next();
			if (file.getName().equals("config.xml")) {
				configFiles.add(file);
			}

		}
		return configFiles;
	}