@Override
  public int readdir(String path, Pointer buff, FuseFillDir filter,
      @off_t long offset, FuseFileInfo fi) {
    final AlluxioURI turi = mPathResolverCache.getUnchecked(path);
    LOG.trace("readdir({}) [Alluxio: {}]", path, turi);

    try {
      final List<URIStatus> ls = mFileSystem.listStatus(turi);
      // standard . and .. entries
      filter.apply(buff, ".", null, 0);
      filter.apply(buff, "..", null, 0);

      for (final URIStatus file : ls) {
        filter.apply(buff, file.getName(), null, 0);
      }
    } catch (FileDoesNotExistException | InvalidPathException e) {
      LOG.debug("Failed to read directory {}, path does not exist or is invalid", path);
      return -ErrorCodes.ENOENT();
    } catch (Throwable t) {
      LOG.error("Failed to read directory {}", path, t);
      return AlluxioFuseUtils.getErrorCode(t);
    }

    return 0;
  }
@ Override public int readdir ( String path , Pointer buff , FuseFillDir filter , @ off_t long offset , FuseFileInfo fi ) { final AlluxioURI turi = mPathResolverCache . getUnchecked ( path ) ; LOG . trace ( "readdir({}) [Alluxio: {}]" , path , turi ) ; try { final List < URIStatus > ls = mFileSystem . listStatus ( turi ) ; filter . apply ( buff , "." , null , 0 ) ; filter . apply ( buff , ".." , null , 0 ) ; for ( final URIStatus file : ls ) { filter . apply ( buff , file . getName ( ) , null , 0 ) ; } } catch ( FileDoesNotExistException | InvalidPathException e ) { LOG . debug ( "Failed to read directory {}, path does not exist or is invalid" , path ) ; return - ErrorCodes . ENOENT ( ) ; } catch ( Throwable t ) { LOG . error ( "Failed to read directory {}" , path , t ) ; return AlluxioFuseUtils . getErrorCode ( t ) ; } return 0 ; }
Reads the contents of a directory.

@param path The FS path of the directory
@param buff The FUSE buffer to fill
@param filter FUSE filter
@param offset Ignored in alluxio-fuse
@param fi FileInfo data structure kept by FUSE
@return 0 on success, a negative value on error