private void initFileDirTables ( Path path ) throws IOException { FileStatus [ ] stats = fs . listStatus ( path ) ; if ( stats != null ) { for ( FileStatus stat : stats ) { if ( stat . isDir ( ) ) { dirs . add ( stat . getPath ( ) . toString ( ) ) ; initFileDirTables ( stat . getPath ( ) ) ; } else { Path filePath = stat . getPath ( ) ; if ( filePath . getName ( ) . startsWith ( StructureGenerator . FILE_NAME_PREFIX ) ) { files . add ( filePath . toString ( ) ) ; } } } } }
Create a table that contains all directories under the specified path and another table that contains all files under the specified path and whose name starts with _file_ .