code: public static String urlEncode(String path) throws URISyntaxException {
          if (isNullOrEmpty(path)) return path;
  
          return UrlEscapers.urlFragmentEscaper().escape(path);
      }
docs: used for encoding url path segment