code: public static long size(String filePath) throws IOException {
          CheckArg.isNotEmpty(filePath, "filePath");
          File file = new File(filePath);
          if (!file.exists()) {
              return 0;
          }
          if (file.isFile()) {
              return file.length();
          }
          final AtomicLong size = new AtomicLong();
          Files.walkFileTree(Paths.get(filePath), new SimpleFileVisitor<Path>() {
              @Override
              public FileVisitResult visitFile( Path file, BasicFileAttributes attrs ) {
                  size.addAndGet(attrs.size());
                  return FileVisitResult.CONTINUE;
              }
  
              @Override
              public FileVisitResult visitFileFailed( Path file, IOException exc ) {
                  return FileVisitResult.CONTINUE;
              }
          });
          return size.get();
      }
docs: Determines the size (in bytes) of the file or directory at the given path.
  
  @param filePath the path of the file; may not be {@code null}
  @return the size in bytes of the file or the total computed size of the folder. If the given path is not a valid file or
  folder, this will return 0.
  @throws IOException if anything unexpected fails.