code: public static long sizeOf(Path path) throws IOException {
      SizeVisitor visitor = new SizeVisitor();
      Files.walkFileTree(path, visitor);
      return visitor.size;
    }
docs: Size of file or directory, in bytes. In case of a directory,
  the size is the sum of the sizes of all files recursively traversed.
  
  This implementation is recommended over commons-io
  {@code FileUtils#sizeOf(File)} which suffers from slow usage of Java IO.
  
  @throws IOException if files can't be traversed or size attribute is not present
  @see BasicFileAttributes#size()