/** * Reads the given subdirectory recursively, applying the given DataEntryReader * to all files that are encountered. */ private void readFiles(File file, DataEntryReader dataEntryReader) throws IOException { // Pass the file data entry to the reader. dataEntryReader.read(new FileDataEntry(directory, file)); if (file.isDirectory()) { // Recurse into the subdirectory. File[] files = file.listFiles(); for (int index = 0; index < files.length; index++) { readFiles(files[index], dataEntryReader); } } } }
/** * Reads the given subdirectory recursively, applying the given DataEntryReader * to all files that are encountered. */ private void readFiles(File file, DataEntryReader dataEntryReader) throws IOException { // Pass the file data entry to the reader. dataEntryReader.read(new FileDataEntry(directory, file)); if (file.isDirectory()) { // Recurse into the subdirectory. File[] listedFiles = file.listFiles(); for (int index = 0; index < listedFiles.length; index++) { File listedFile = listedFiles[index]; try { readFiles(listedFile, dataEntryReader); } catch (IOException e) { throw new IOException("Can't read ["+listedFile.getName()+"] ("+e.getMessage()+")", e); } } } } }
/** * Reads the given subdirectory recursively, applying the given DataEntryReader * to all files that are encountered. */ private void readFiles(File file, DataEntryReader dataEntryReader) throws IOException { // Pass the file data entry to the reader. dataEntryReader.read(new FileDataEntry(directory, file)); if (file.isDirectory()) { // Recurse into the subdirectory. File[] listedFiles = file.listFiles(); for (int index = 0; index < listedFiles.length; index++) { File listedFile = listedFiles[index]; try { readFiles(listedFile, dataEntryReader); } catch (IOException e) { throw new IOException("Can't read ["+listedFile.getName()+"] ("+e.getMessage()+")", e); } } } } }
/** * Reads the given subdirectory recursively, applying the given DataEntryReader * to all files that are encountered. */ private void readFiles(File file, DataEntryReader dataEntryReader) throws IOException { // Pass the file data entry to the reader. dataEntryReader.read(new FileDataEntry(directory, file)); if (file.isDirectory()) { // Recurse into the subdirectory. File[] listedFiles = file.listFiles(); for (int index = 0; index < listedFiles.length; index++) { File listedFile = listedFiles[index]; try { readFiles(listedFile, dataEntryReader); } catch (IOException e) { throw new IOException("Can't read ["+listedFile.getName()+"] ("+e.getMessage()+")", e); } } } } }