code: void stat(char[] fmt, String src) throws IOException {
      Path srcPath = new Path(src);
      FileSystem srcFs = srcPath.getFileSystem(getConf());
      FileStatus glob[] = srcFs.globStatus(srcPath);
      if (null == glob)
        throw new IOException("cannot stat `" + src + "': No such file or directory");
      for (FileStatus f : glob) {
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < fmt.length; ++i) {
          if (fmt[i] != '%') {
            buf.append(fmt[i]);
          } else {
            if (i + 1 == fmt.length) break;
            switch(fmt[++i]) {
              case 'b':
                buf.append(f.getLen());
                break;
              case 'F':
                buf.append(f.isDir() ? "directory" : "regular file");
                break;
              case 'n':
                buf.append(f.getPath().getName());
                break;
              case 'o':
                buf.append(f.getBlockSize());
                break;
              case 'r':
                buf.append(f.getReplication());
                break;
              case 'y':
                buf.append(modifFmt.format(new Date(f.getModificationTime())));
                break;
              case 'Y':
                buf.append(f.getModificationTime());
                break;
              default:
                buf.append(fmt[i]);
                break;
            }
          }
        }
        System.out.println(buf.toString());
      }
    }
docs: Print statistics about path in specified format.
  Format sequences:
  %b: Size of file in blocks
  %n: Filename
  %o: Block size
  %r: replication
  %y: UTC date as &quot;yyyy-MM-dd HH:mm:ss&quot;
  %Y: Milliseconds since January 1, 1970 UTC