public String getRangerImportUrl(String rangerUrl, String dbName) throws URISyntaxException {
    URIBuilder uriBuilder = new URIBuilder(rangerUrl);
    uriBuilder.setPath(RANGER_REST_URL_IMPORTJSONFILE);
    uriBuilder.addParameter("updateIfExists", "true");
    uriBuilder.addParameter("polResource", dbName);
    uriBuilder.addParameter("policyMatchingAlgorithm", "matchByName");
    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