code: void du(String src) throws IOException {
      Path srcPath = new Path(src);
      FileSystem srcFs = srcPath.getFileSystem(getConf());
      Path[] pathItems = FileUtil.stat2Paths(srcFs.globStatus(srcPath), 
                                             srcPath);
      FileStatus items[] = srcFs.listStatus(pathItems);
      if ((items == null) || ((items.length == 0) && 
          (!srcFs.exists(srcPath)))){
        throw new FileNotFoundException("Cannot access " + src
              + ": No such file or directory.");
      } else {
        System.out.println("Found " + items.length + " items");
        int maxLength = 10;
        
        long length[] = new long[items.length];
        for (int i = 0; i < items.length; i++) {
          length[i] = items[i].isDir() ?
            srcFs.getContentSummary(items[i].getPath()).getLength() :
            items[i].getLen();
          int len = String.valueOf(length[i]).length();
          if (len > maxLength) maxLength = len;
        }
        for(int i = 0; i < items.length; i++) {
          System.out.printf("%-"+ (maxLength + BORDER) +"d", length[i]);
          System.out.println(items[i].getPath());
        }
      }
    }
docs: Show the size of all files that match the file pattern <i>src</i>
  @param src a file pattern specifying source files
  @throws IOException
  @see org.apache.hadoop.fs.FileSystem#globStatus(Path)