docs: public static String cleanPath(String path) {
          if (path.endsWith(SEPARATOR)) {
              path = path.replaceAll(SEPARATOR + "+$", "");
          }
          if (path.startsWith(SEPARATOR)) {
              path = path.replaceAll("^" + SEPARATOR + "+", "");
          }
          return path.replaceAll("/+", SEPARATOR);
      }