public String getRangerDeleteUrl(String rangerUrl, String policyName, String serviceName) throws URISyntaxException {
    URIBuilder uriBuilder = new URIBuilder(rangerUrl);
    uriBuilder.setPath(RANGER_REST_URL_DELETEPOLICY);
    uriBuilder.addParameter("servicename", serviceName);
    uriBuilder.addParameter("policyname", policyName);
    return uriBuilder.build().toString();
  }
RangerRestClientImpl to connect to Ranger and export policies.
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerRestClientImpl.java