docs: public static String encodePath(String path) {
      StringBuffer encodedPathBuf = new StringBuffer();
      for (String pathSegment : path.split("/")) {
        if (!pathSegment.isEmpty()) {
          if (encodedPathBuf.length() > 0) {
            encodedPathBuf.append("/");
          }
          encodedPathBuf.append(S3Escaper.encode(pathSegment));
        }
      }
  
      if (path.startsWith("/")) {
        encodedPathBuf.insert(0, "/");
      }
      if (path.endsWith("/")) {
        encodedPathBuf.append("/");
      }
  
      return encodedPathBuf.toString();
    }