private String encode(String s) throws BuildMethodException { try { return URIUtil.encodePathQuery(s, "UTF-8"); } catch (URIException e) { throw new BuildMethodException("Cannot create URI"); } }
public static String encodeUri(String uri) { try { return URIUtil.encodePathQuery(uri); } catch (URIException ex) { throw new EsHadoopIllegalArgumentException("Cannot escape uri" + uri); } }