code: private static void statFile(String fname) {
      try {
        Path path = Paths.get(new URI(fname));
        long size = Files.size(path);
        System.out.println(fname + ": " + size + " bytes.");
      } catch (Exception ex) {
        System.out.println(fname + ": " + ex.toString());
      }
    }
docs: Print the length of the indicated file.
  
  <p>This uses the normal Java NIO Api, so it can take advantage of any installed NIO Filesystem
  provider without any extra effort.