/** * Transform params map of request to URL link. * * @param paramsMap the params map * @return URL string */ public static String generateParamsUrl(Map<String, String> paramsMap) { String paramsUrl = ""; for (String key : paramsMap.keySet()) { String val = paramsMap.get(key); if (paramsUrl.length() > 0) { paramsUrl += PARAMS_SEPARATOR; } paramsUrl += key + "=" + URL.encodeQueryString(val); } return paramsUrl; }
/** * Generate token. * * @return the token */ public static String generateToken() { StringBuilder paramsUrl = new StringBuilder(); for (String key : paramsMap.keySet()) { String val = paramsMap.get(key); if (paramsUrl.length() > 0) { paramsUrl.append(PARAMS_SEPARATOR); } paramsUrl.append(key).append("=").append(URL.encodeQueryString(val)); } return paramsUrl.toString(); }
/** * Download user configuration. * * @param externalUId the external user identifier * @param schemaVersion the configuration schema version * @param appId the application identifier */ public static void downloadUserConfiguration(String externalUId, String schemaVersion, String appId) { String getUrl = composeUrl(KAA_USER_CONFIGURATION_SERVLET_PATH, APPLICATION_ID_PARAMETER + "=" + URL.encodeQueryString(appId), USER_EXTERNAL_ID_PARAMETER + "=" + URL.encodeQueryString(externalUId), CONFIGURATION_SCHEMA_ID + "=" + URL.encodeQueryString(schemaVersion)); String url = GWT.getModuleBaseURL() + getUrl; Window.open(url, "_self", "enabled"); }
/** * Download endpoint profile. * * @param endpointKey the endpoint key * @param type the type of an endpoint */ public static void downloadEndpointProfile(String endpointKey, ProfileType type) { String getUrl = composeUrl(KAA_PROFILE_DOWNLOAD_SERVLET_PATH, ENDPOINT_KEY_PARAMETER + "=" + URL.encodeQueryString(endpointKey), PROFILE_TYPE_PARAMETER + "=" + URL.encodeQueryString(type.name())); String url = GWT.getModuleBaseURL() + getUrl; Window.open(url, "_self", "enabled"); }
/** * Download record library. * * @param key the record library key */ public static void downloadRecordLibrary(String key) { String getUrl = composeUrl(KAA_RECORD_LIBRARY_SERVLET_PATH, RECORD_KEY_PARAMETER + "=" + URL.encodeQueryString(key)); String url = GWT.getModuleBaseURL() + getUrl; Window.open(url, "_self", "enabled"); }
/** * Download endpoint configuration. * * @param endpointKeyHash the endpoint key hash */ public static void downloadEndpointConfiguration(String endpointKeyHash) { String getUrl = composeUrl(EP_CONF_SERVLET_PATH, ENDPOINT_KEY_PARAMETER + "=" + URL.encodeQueryString(endpointKeyHash)); String url = GWT.getModuleBaseURL() + getUrl; Window.open(url, "_self", "enabled"); }
/** * Export CTL schema. * * @param key the CTL export key */ public static void exportCtlSchema(String key) { String getUrl = composeUrl(KAA_CTL_EXPORT_SERVLET_PATH, CTL_EXPORT_KEY_PARAMETER + "=" + URL.encodeQueryString(key)); String url = GWT.getModuleBaseURL() + getUrl; Window.open(url, "_self", "enabled"); }
/** * Download the SDK. * * @param key the SDK key */ public static void downloadSdk(String key) { String getUrl = composeUrl(KAA_SDK_SERVLET_PATH, SDK_KEY_PARAMETER + "=" + URL.encodeQueryString(key)); String url = GWT.getModuleBaseURL() + getUrl; Window.open(url, "_self", "enabled"); }
return encodeQueryString(decodedURLComponent);
for (String val : entry.getValue()) { url.append(prefix) .append(URL.encodeQueryString(entry.getKey())) .append('='); if (val != null) { url.append(URL.encodeQueryString(val));
protected String createURL(final String callbackName, final int id, final String query) { // Needed to bracket the query with some delimiter, otherwise trailing whitespace // gets lost. final String encode = URL.encodeQueryString( query ); return urlSuggestServlet + "?callback=" + callbackName + "&id=" + id + "&q=\"" + encode + "\""; }
public void addParameter(String name, String value) { if (value == null) { return; } textContent.append((ampersand ? "&" : "") + URL.encodeQueryString(name) + "=" + URL.encodeQueryString(value)); ampersand = true; }
public void addParameter(String name, String value) { if (value == null) { return; } textContent.append((ampersand ? "&" : "") + URL.encodeQueryString(name) + "=" + URL.encodeQueryString(value)); ampersand = true; }
public Resource addQueryParam(String key, String value) { if (value == null) { return this; } key = URL.encodeQueryString(key); value = URL.encodeQueryString(value); String q = query == null ? "" : query + "&"; return new Resource(path, q + key + "=" + value, headers); }
public Resource addQueryParam(String key, String value) { if (value == null) { return this; } key = URL.encodeQueryString(key); value = URL.encodeQueryString(value); String q = query == null ? "" : query + "&"; return new Resource(path, q + key + "=" + value, headers); }
public String render() { StringBuilder sb = new StringBuilder(); for(String property : propertyValues.keySet()) { sb.append(URL.encodeQueryString(property)); sb.append(PROPERTY_VALUE_SEPARATOR); final String value = propertyValues.get(property); sb.append(URL.encodeQueryString(value)); sb.append(PROPERTY_VALUE_ITEM_SEPARATOR); } return sb.toString(); }
private void computeParamList() { paramList = ""; if ( rpInstitution != null ) { paramList += "&" + RESOURCE_PROVIDER_INSTITUTION_PARAM + "=" + URL.encodeQueryString( rpInstitution.toString() ); } if ( classURI != null ) { paramList += "&" + BINDING_TYPE_PARAM + "=" + URL.encodeQueryString( classURI.toString() ); } if ( property != null ) { paramList += "&" + PROPERTY_PARAM + "=" + URL.encodeQueryString( property ); } }
private void computeParamList() { paramList = ""; if ( classURI != null ) { paramList += "&classid=" + URL.encodeQueryString( classURI.toString() ); } }
private void appendRCU(StringBuilder builder) { Set<EIEntity> rcuEntitySet = cellLine.getObjectProperty( inCollectionProperty.getEntity() ); if ( rcuEntitySet == null || rcuEntitySet.isEmpty() ) { return; } EIEntity rcuEntity = rcuEntitySet.iterator().next(); String rcuLabel = urlEncodeDecodeParamLabels ? URL.encodeQueryString( rcuEntity.getLabel() ) : rcuEntity.getLabel(); appendParam( builder, COLLECTION_LABEL_KEY, rcuLabel ); appendParam( builder, COLLECTION_KEY, rcuEntity.getURI().toString() ); }
@Override public Promise<String> evaluate(String id, String expression, long threadId, int frameIndex) { String requestUrl = getBaseUrl(id) + "/evaluation?thread=" + threadId + "&frame=" + frameIndex; String params = "&expression=" + URL.encodeQueryString(expression); return asyncRequestFactory .createGetRequest(requestUrl + params) .loader(loaderFactory.newLoader()) .send(new StringUnmarshaller()); }