@ Override public FileStatus [ ] listStatus ( Path f ) throws IOException { //need to see if the file is an index in file //get the filestatus of the archive directory // we will create fake filestatuses to return // to the client List < FileStatus > statuses = new ArrayList < FileStatus > ( ) ; FileStatus archiveStatus = fs . getFileStatus ( archiveIndex ) ; Path tmpPath = makeQualified ( f ) ; Path harPath = getPathInHar ( tmpPath ) ; String readStr = fileStatusInIndex ( harPath ) ; if ( readStr == null ) { throw new FileNotFoundException ( "File " + f + " not found in " + archivePath ) ; } HarStatus hstatus = new HarStatus ( readStr , archiveStatus , version ) ; if ( ! hstatus . isDir ( ) ) { statuses . add ( new FileStatus ( hstatus . getLength ( ) , hstatus . isDir ( ) , archiveStatus . getReplication ( ) , archiveStatus . getBlockSize ( ) , hstatus . getModificationTime ( ) , hstatus . getAccessTime ( ) , new FsPermission ( hstatus . getPermission ( ) ) , hstatus . getOwner ( ) , hstatus . getGroup ( ) , makeRelative ( this . uri . getPath ( ) , new Path ( hstatus . getName ( ) ) ) ) ) ; } else { fileStatusesInIndex ( hstatus , statuses , hstatus . getChildren ( ) , archiveStatus ) ; } return statuses . toArray ( new FileStatus [ statuses . size ( ) ] ) ; }
liststatus returns the children of a directory after looking up the index files .