/** * Give a URI break off any URI options and store them in a Key / Value Mapping. * * @param uri The URI whose query should be extracted and processed. * @return A Mapping of the URI options. * @throws java.net.URISyntaxException */ public static Map<String, String> parseQuery(String uri) throws URISyntaxException { try { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query Map<String, String> rc = new HashMap<>(); if (uri != null && !uri.isEmpty()) { parseParameters(rc, uri.split("[&;]")); } return rc; } catch (UnsupportedEncodingException e) { throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e); } }
/** * Give a URI break off any URI options and store them in a Key / Value Mapping. * * @param uri The URI whose query should be extracted and processed. * @return A Mapping of the URI options. * @throws java.net.URISyntaxException */ public static Map<String, String> parseQuery(String uri) throws URISyntaxException { try { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query Map<String, String> rc = new HashMap<>(); if (uri != null && !uri.isEmpty()) { parseParameters(rc, uri.split("[&;]")); } return rc; } catch (UnsupportedEncodingException e) { throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e); } }
/** * Give a URI break off any URI options and store them in a Key / Value Mapping. * * @param uri The URI whose query should be extracted and processed. * @return A Mapping of the URI options. * @throws java.net.URISyntaxException */ public static Map<String, String> parseQuery(String uri) throws URISyntaxException { try { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query Map<String, String> rc = new HashMap<>(); if (uri != null && !uri.isEmpty()) { parseParameters(rc, uri.split("[&;]")); } return rc; } catch (UnsupportedEncodingException e) { throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e); } }
/** * Give a URI break off any URI options and store them in a Key / Value Mapping. * * @param uri The URI whose query should be extracted and processed. * @return A Mapping of the URI options. * @throws java.net.URISyntaxException */ public static Map<String, String> parseQuery(String uri) throws URISyntaxException { try { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query Map<String, String> rc = new HashMap<>(); if (uri != null && !uri.isEmpty()) { parseParameters(rc, uri.split("[&;]")); } return rc; } catch (UnsupportedEncodingException e) { throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e); } }
/** * Give a URI break off any URI options and store them in a Key / Value Mapping. * * @param uri The URI whose query should be extracted and processed. * @return A Mapping of the URI options. * @throws java.net.URISyntaxException */ public static Map<String, String> parseQuery(String uri) throws URISyntaxException { try { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query Map<String, String> rc = new HashMap<>(); if (uri != null && !uri.isEmpty()) { parseParameters(rc, uri.split("[&;]")); } return rc; } catch (UnsupportedEncodingException e) { throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e); } }
/** * Give a URI break off any URI options and store them in a Key / Value Mapping. * * @param uri The URI whose query should be extracted and processed. * @return A Mapping of the URI options. * @throws java.net.URISyntaxException */ public static Map<String, String> parseQuery(String uri) throws URISyntaxException { try { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query Map<String, String> rc = new HashMap<>(); if (uri != null && !uri.isEmpty()) { parseParameters(rc, uri.split("[&;]")); } return rc; } catch (UnsupportedEncodingException e) { throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e); } }
/** * Give a URI break off any URI options and store them in a Key / Value Mapping. * * @param uri The URI whose query should be extracted and processed. * @return A Mapping of the URI options. * @throws java.net.URISyntaxException */ public static Map<String, String> parseQuery(String uri) throws URISyntaxException { try { uri = uri.substring(uri.lastIndexOf("?") + 1); // get only the relevant part of the query Map<String, String> rc = new HashMap<>(); if (uri != null && !uri.isEmpty()) { parseParameters(rc, uri.split("[&;]")); } return rc; } catch (UnsupportedEncodingException e) { throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e); } }
@Override public void populateObject(URI uri, ClusterConnectionConfiguration bean) throws Exception { if (URISupport.isCompositeURI(uri)) { super.populateObject(uri, bean); } else { bean.setDiscoveryGroupName(uri.getHost()); Map<String, String> parameters = URISupport.parseParameters(uri); BeanSupport.setData(uri, bean, parameters); } }