/** * Returns the list of files at 'path' recursively. This skips files that are ignored normally * by MapReduce. */ public static List<String> listDirectory(File path) throws IOException { List<String> result = new ArrayList<>(); if (path.isDirectory()) { for (File f: path.listFiles()) { result.addAll(listDirectory(f)); } } else { char c = path.getName().charAt(0); if (c != '.' && c != '_') { result.add(path.getAbsolutePath()); } } return result; }
/** * Returns the list of files at 'path' recursively. This skips files that are ignored normally * by MapReduce. */ public static List<String> listDirectory(File path) { List<String> result = new ArrayList<>(); if (path.isDirectory()) { for (File f: path.listFiles()) { result.addAll(listDirectory(f)); } } else { char c = path.getName().charAt(0); if (c != '.' && c != '_') { result.add(path.getAbsolutePath()); } } return result; }
/** * Returns the list of files at 'path' recursively. This skips files that are ignored normally * by MapReduce. */ public static List<String> listDirectory(File path) { List<String> result = new ArrayList<>(); if (path.isDirectory()) { for (File f: path.listFiles()) { result.addAll(listDirectory(f)); } } else { char c = path.getName().charAt(0); if (c != '.' && c != '_') { result.add(path.getAbsolutePath()); } } return result; }
/** * Returns the list of files at 'path' recursively. This skips files that are ignored normally * by MapReduce. */ public static List<String> listDirectory(File path) throws IOException { List<String> result = new ArrayList<>(); if (path.isDirectory()) { for (File f: path.listFiles()) { result.addAll(listDirectory(f)); } } else { char c = path.getName().charAt(0); if (c != '.' && c != '_') { result.add(path.getAbsolutePath()); } } return result; }