public static long getOccupiedSpace(String folderPath) throws IOException {
    Path folder = Paths.get(folderPath);
    try (Stream<Path> s = Files.walk(folder)) {
      return s.filter(p -> p.toFile().isFile()).mapToLong(p -> p.toFile().length()).sum();
    }
  }
NOTICE: This method is currently used only for data dir, thus using FSFactory to get file

@param dir directory path
@return
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/JVMCommonUtils.java