code: @Deprecated
      public static String encodePath(String path) {
          try {
              return URIUtil.encodePath(path, "UTF-8");
          } catch (URIException ex) {
              throw new EsHadoopIllegalArgumentException("Cannot encode path segment [" + path + "]", ex);
          }
      }
docs: Encodes characters in the string except for those allowed in an absolute path.
  
  @deprecated Prefer to use {@link HttpEncodingTools#encode(String)} instead for encoding specific
  pieces of the URI. This method does not escape certain reserved characters, like '/' and ':'.
  As such, this is not safe to use on paths that may contain these reserved characters in the wrong places.