private URI createURI(String query,
			Collection<? extends NameValuePair> origParams) {
		final List<NameValuePair> params = new ArrayList<NameValuePair>(
				origParams);
		if (apiAccessKey != null) {
			params.add(new BasicNameValuePair("key", apiAccessKey));
		}
		URI uri;
		try {
			URL url = baseURL;
			String path = url.getPath();
			if (!query.isEmpty()) {
				path += "/" + query;
			}
			uri = URIUtils.createURI(url.getProtocol(), url.getHost(),
					url.getPort(), path,
					URLEncodedUtils.format(params, "UTF-8"), null);
		} catch (URISyntaxException e) {
			throw new RedmineInternalError(e);
		}
		return uri;
	}
private URI createURI ( String query , Collection < ? extends NameValuePair > origParams ) { final List < NameValuePair > params = new ArrayList < NameValuePair > ( origParams ) ; if ( apiAccessKey != null ) { params . add ( new BasicNameValuePair ( "key" , apiAccessKey ) ) ; } URI uri ; try { URL url = baseURL ; String path = url . getPath ( ) ; if ( ! query . isEmpty ( ) ) { path += "/" + query ; } uri = URIUtils . createURI ( url . getProtocol ( ) , url . getHost ( ) , url . getPort ( ) , path , URLEncodedUtils . format ( params , "UTF-8" ) , null ) ; } catch ( URISyntaxException e ) { throw new RedmineInternalError ( e ) ; } return uri ; }
@param query
e.g. "/issues.xml"
@return URI with auth parameter "key" if not in "basic auth mode.