/** * Removes any URI query from the given uri and return a new URI that does not contain the query portion. * * @param uri * The URI whose query value is to be removed. * * @return a new URI that does not contain a query value. * @throws URISyntaxException */ public static URI removeQuery(URI uri) throws URISyntaxException { return createURIWithQuery(uri, null); }
private URI addExtraQueryOptions(URI uri) { try { if( nestedExtraQueryOptions!=null && !nestedExtraQueryOptions.isEmpty() ) { if( uri.getQuery() == null ) { uri = URISupport.createURIWithQuery(uri, nestedExtraQueryOptions); } else { uri = URISupport.createURIWithQuery(uri, uri.getQuery()+"&"+nestedExtraQueryOptions); } } } catch (URISyntaxException e) { throw new RuntimeException(e); } return uri; }
/** * Creates a URI from the original URI and the remaining parameters. * * When the query options of a URI are applied to certain objects the used portion of the query options needs * to be removed and replaced with those that remain so that other parts of the code can attempt to apply the * remainder or give an error is unknown values were given. This method is used to update a URI with those * remainder values. * * @param originalURI * The URI whose current parameters are remove and replaced with the given remainder value. * @param params * The URI params that should be used to replace the current ones in the target. * * @return a new URI that matches the original one but has its query options replaced with the given ones. * @throws URISyntaxException */ public static URI createRemainingURI(URI originalURI, Map<String, String> params) throws URISyntaxException { String s = createQueryString(params); if (s.length() == 0) { s = null; } return createURIWithQuery(originalURI, s); }
private static Transport createLocalTransport(URI uri, boolean async) throws Exception { HashMap<String, String> map = new HashMap<String, String>(URISupport.parseParameters(uri)); map.put("async", String.valueOf(async)); map.put("create", "false"); // we don't want a vm connect during shutdown to trigger a broker create uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map)); return TransportFactory.connect(uri); }
uri = createURIWithQuery(uri, newQuery.toString());
/** * Removes any URI query from the given uri and return a new URI that does not contain the query portion. * * @param uri * The URI whose query value is to be removed. * * @return a new URI that does not contain a query value. * @throws URISyntaxException */ public static URI removeQuery(URI uri) throws URISyntaxException { return createURIWithQuery(uri, null); }
/** * Removes any URI query from the given uri and return a new URI that does not contain the query portion. * * @param uri * The URI whose query value is to be removed. * * @return a new URI that does not contain a query value. * @throws URISyntaxException */ public static URI removeQuery(URI uri) throws URISyntaxException { return createURIWithQuery(uri, null); }
/** * Removes any URI query from the given uri and return a new URI that does not contain the query portion. * * @param uri * The URI whose query value is to be removed. * * @return a new URI that does not contain a query value. * @throws URISyntaxException */ public static URI removeQuery(URI uri) throws URISyntaxException { return createURIWithQuery(uri, null); }
/** * Removes any URI query from the given uri */ public static URI removeQuery(URI uri) throws URISyntaxException { return createURIWithQuery(uri, null); }
private URI addExtraQueryOptions(URI uri) { try { if( nestedExtraQueryOptions!=null && !nestedExtraQueryOptions.isEmpty() ) { if( uri.getQuery() == null ) { uri = URISupport.createURIWithQuery(uri, nestedExtraQueryOptions); } else { uri = URISupport.createURIWithQuery(uri, uri.getQuery()+"&"+nestedExtraQueryOptions); } } } catch (URISyntaxException e) { throw new RuntimeException(e); } return uri; }
private URI addExtraQueryOptions(URI uri) { try { if( nestedExtraQueryOptions!=null && !nestedExtraQueryOptions.isEmpty() ) { if( uri.getQuery() == null ) { uri = URISupport.createURIWithQuery(uri, nestedExtraQueryOptions); } else { uri = URISupport.createURIWithQuery(uri, uri.getQuery()+"&"+nestedExtraQueryOptions); } } } catch (URISyntaxException e) { throw new RuntimeException(e); } return uri; }
private URI addExtraQueryOptions(URI uri) { try { if( nestedExtraQueryOptions!=null && !nestedExtraQueryOptions.isEmpty() ) { if( uri.getQuery() == null ) { uri = URISupport.createURIWithQuery(uri, nestedExtraQueryOptions); } else { uri = URISupport.createURIWithQuery(uri, uri.getQuery()+"&"+nestedExtraQueryOptions); } } } catch (URISyntaxException e) { throw new RuntimeException(e); } return uri; }
/** * Creates a URI from the original URI and the remaining paramaters * * @throws URISyntaxException */ public static URI createRemainingURI(URI originalURI, Map params) throws URISyntaxException { String s = createQueryString(params); if (s.length() == 0) { s = null; } return createURIWithQuery(originalURI, s); }
public static URI applyParameters(URI uri, Map<String, String> queryParameters, String optionPrefix) throws URISyntaxException { if (queryParameters != null && !queryParameters.isEmpty()) { StringBuffer newQuery = uri.getRawQuery() != null ? new StringBuffer(uri.getRawQuery()) : new StringBuffer() ; for ( Map.Entry<String, String> param: queryParameters.entrySet()) { if (param.getKey().startsWith(optionPrefix)) { if (newQuery.length()!=0) { newQuery.append('&'); } final String key = param.getKey().substring(optionPrefix.length()); newQuery.append(key).append('=').append(param.getValue()); } } uri = createURIWithQuery(uri, newQuery.toString()); } return uri; }
/** * Creates a URI from the original URI and the remaining parameters. * * When the query options of a URI are applied to certain objects the used portion of the query options needs * to be removed and replaced with those that remain so that other parts of the code can attempt to apply the * remainder or give an error is unknown values were given. This method is used to update a URI with those * remainder values. * * @param originalURI * The URI whose current parameters are remove and replaced with the given remainder value. * @param params * The URI params that should be used to replace the current ones in the target. * * @return a new URI that matches the original one but has its query options replaced with the given ones. * @throws URISyntaxException */ public static URI createRemainingURI(URI originalURI, Map<String, String> params) throws URISyntaxException { String s = createQueryString(params); if (s.length() == 0) { s = null; } return createURIWithQuery(originalURI, s); }
/** * Creates a URI from the original URI and the remaining parameters. * * When the query options of a URI are applied to certain objects the used portion of the query options needs * to be removed and replaced with those that remain so that other parts of the code can attempt to apply the * remainder or give an error is unknown values were given. This method is used to update a URI with those * remainder values. * * @param originalURI * The URI whose current parameters are remove and replaced with the given remainder value. * @param params * The URI params that should be used to replace the current ones in the target. * * @return a new URI that matches the original one but has its query options replaced with the given ones. * @throws URISyntaxException */ public static URI createRemainingURI(URI originalURI, Map<String, String> params) throws URISyntaxException { String s = createQueryString(params); if (s.length() == 0) { s = null; } return createURIWithQuery(originalURI, s); }
private static Transport createLocalTransport(URI uri, boolean async) throws Exception { HashMap<String, String> map = new HashMap<String, String>(URISupport.parseParameters(uri)); map.put("async", String.valueOf(async)); map.put("create", "false"); // we don't want a vm connect during shutdown to trigger a broker create uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map)); return TransportFactory.connect(uri); }
private static Transport createLocalTransport(URI uri, boolean async) throws Exception { HashMap<String, String> map = new HashMap<String, String>(URISupport.parseParameters(uri)); map.put("async", String.valueOf(async)); map.put("create", "false"); // we don't want a vm connect during shutdown to trigger a broker create uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map)); return TransportFactory.connect(uri); }
/** * Creates a URI from the original URI and the remaining parameters. * * When the query options of a URI are applied to certain objects the used portion of the query options needs * to be removed and replaced with those that remain so that other parts of the code can attempt to apply the * remainder or give an error is unknown values were given. This method is used to update a URI with those * remainder values. * * @param originalURI * The URI whose current parameters are remove and replaced with the given remainder value. * @param params * The URI params that should be used to replace the current ones in the target. * * @return a new URI that matches the original one but has its query options replaced with the given ones. * @throws URISyntaxException */ public static URI createRemainingURI(URI originalURI, Map<String, String> params) throws URISyntaxException { String s = createQueryString(params); if (s.length() == 0) { s = null; } return createURIWithQuery(originalURI, s); }
private static Transport createLocalTransport(URI uri, boolean async) throws Exception { HashMap<String, String> map = new HashMap<String, String>(URISupport.parseParameters(uri)); map.put("async", String.valueOf(async)); map.put("create", "false"); // we don't want a vm connect during shutdown to trigger a broker create uri = URISupport.createURIWithQuery(uri, URISupport.createQueryString(map)); return TransportFactory.connect(uri); }