/** * Returns a map parameter for a given cartridge. * * @param cartridge the cartridge that a request parameter shall get created for * @return the parameter */ private ParameterValueMap createCartridgeParameter(ICartridge cartridge) { if (cartridge.isDownloadable()) { return new ParameterValueMap() .add(IOpenShiftJsonConstants.PROPERTY_URL, UrlUtils.toString(cartridge.getUrl())); } else { return new ParameterValueMap() .add(IOpenShiftJsonConstants.PROPERTY_NAME, cartridge.getName()); } }
public RestService(String baseUrl, String clientId, IHttpClient client) { this.baseUrl = UrlUtils.ensureStartsWithHttps(baseUrl); this.client = client; client.setUserAgent(new RestServiceProperties().getUseragent(clientId)); client.setVersion(SERVICE_VERSION); }