private Path [ ] listPaths ( final Path path ) throws IOException { Path [ ] children = null ; ArrayList < Path > tmpChildrenPath = new ArrayList <> ( ) ; if ( fs . isDirectory ( path ) ) { // Get children's path list. FileStatus [ ] chiledrenFileStatus = pathFilter == null ? fs . listStatus ( path ) : fs . listStatus ( path , pathFilter ) ; for ( FileStatus childFileStatus : chiledrenFileStatus ) { tmpChildrenPath . add ( childFileStatus . getPath ( ) ) ; } children = tmpChildrenPath . toArray ( new Path [ tmpChildrenPath . size ( ) ] ) ; } if ( children == null ) { children = EMPTY_PATH_ARRAY ; } if ( comparator != null && children . length > 1 ) { Arrays . sort ( children , comparator ) ; } return children ; }
List the contents of a directory denoted by Path