/** * @See org.springframework.extensions.surf.util.URLEncoder.encodeUriComponent(s) */ public static String encode(String s) { return encode(s, false); }
/** * Returns the Ticket as a URL Escaped Parameter fragment, such as * "ticket=12%20xx&sig=2". Special characters in the URL are escaped * suitable for using as full URL, but any ampersands are not escaped * (it's not HTML escaped) */ public String getAsEscapedUrlParameters() { String unescaped = getAsUrlParameters(); return URLEncoder.encodeUri(unescaped); }
/** * <p>Build the REST URl to use to retrieve the metadata for the supplied user</p> * * @param context RequestContext * @param userId String * @param endpointId String * @return String */ protected String buildUserMetadataRestUrl(RequestContext context, String userId, String endpointId) { return DEFAULT_USER_URL_PREFIX + URLEncoder.encode(userId); }
/** * Returns the Ticket as a URL Escaped Parameter fragment, such as * "ticket=12%20xx&sig=2". Special characters in the URL are escaped * suitable for using as full URL, but any ampersands are not escaped * (it's not HTML escaped) */ public String getAsEscapedUrlParameters() { String unescaped = getAsUrlParameters(); return URLEncoder.encodeUri(unescaped); }
/** * <p>Build the REST URl to use to retrieve the metadata for the supplied user</p> * * @param context RequestContext * @param userId String * @param endpointId String * @return String */ protected String buildUserMetadataRestUrl(RequestContext context, String userId, String endpointId) { return DEFAULT_USER_URL_PREFIX + URLEncoder.encode(userId); }
/** * @see freemarker.template.TemplateMethodModel#exec(java.util.List) */ public Object exec(List args) throws TemplateModelException { String result = ""; if (args.size() == 1) { Object arg0 = args.get(0); if (arg0 instanceof TemplateScalarModel) { result = URLEncoder.encodeUri(((TemplateScalarModel)arg0).getAsString()); } } return result; } }
return encode(s, false);
/** * @see freemarker.template.TemplateMethodModel#exec(java.util.List) */ public Object exec(List args) throws TemplateModelException { String result = ""; if (args.size() == 1) { Object arg0 = args.get(0); if (arg0 instanceof TemplateScalarModel) { result = URLEncoder.encodeUri(((TemplateScalarModel)arg0).getAsString()); } } return result; } }
return encode(s, true);
/** * @see freemarker.template.TemplateMethodModel#exec(java.util.List) */ public Object exec(List args) throws TemplateModelException { String result = ""; if (args.size() == 1) { Object arg0 = args.get(0); if (arg0 instanceof TemplateScalarModel) { result = URLEncoder.encodeUri(((TemplateScalarModel)arg0).getAsString()); } } return result; } }
private String buildUrlParamString(Map<String, String> properties) { StringBuilder params = new StringBuilder("?inviteId="); params.append(properties.get(WF_INSTANCE_ID)); params.append("&inviteeUserName="); params.append(URLEncoder.encode(properties.get(wfVarInviteeUserName))); params.append("&siteShortName="); params.append(properties.get(wfVarResourceName)); params.append("&inviteTicket="); params.append(properties.get(wfVarInviteTicket)); return params.toString(); }
@ScriptMethod ( help="Encode input URL string", output="Processed string" ) public String urlEncodeComponent(@ScriptParameter(help="Input string") String s) { return URLEncoder.encodeUri(s); }
private String buildUrlParamString(Map<String, String> properties) { StringBuilder params = new StringBuilder("?inviteId="); params.append(properties.get(WF_INSTANCE_ID)); params.append("&inviteeUserName="); params.append(URLEncoder.encode(properties.get(wfVarInviteeUserName))); params.append("&siteShortName="); params.append(properties.get(wfVarResourceName)); params.append("&inviteTicket="); params.append(properties.get(wfVarInviteTicket)); return params.toString(); }
@ScriptMethod ( help="Encode input URL string", output="Processed string" ) public String urlEncodeComponent(@ScriptParameter(help="Input string") String s) { return URLEncoder.encodeUri(s); }
buffer.append("&" + key + "=" + URLEncoder.encode(value));
@ScriptMethod ( help="Encode input URL string", output="Processed string" ) public String urlEncodeComponent(@ScriptParameter(help="Input string") String s) { return URLEncoder.encodeUri(s); }
public String object(RequestContext context, String objectId, String formatId, Map<String, String> params) { if (objectId == null) { throw new IllegalArgumentException("ObjectId is mandatory."); } StringBuilder buffer = new StringBuilder(64); buffer.append(context.getContextPath()); if (formatId != null) { buffer.append("?f=" + formatId); } buffer.append("&o=" + objectId); if (params != null) { for (Map.Entry<String, String> entry : params.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); buffer.append("&" + key + "=" + URLEncoder.encode(value)); } } return buffer.toString(); }
StringTokenizer t = new StringTokenizer(URLEncoder.encodeUri(uri), "/"); if (!t.hasMoreTokens())
public String object(RequestContext context, String objectId, String formatId, Map<String, String> params) { if (objectId == null) { throw new IllegalArgumentException("ObjectId is mandatory."); } StringBuilder buffer = new StringBuilder(64); buffer.append(context.getContextPath()); if (formatId != null) { buffer.append("?f=" + formatId); } buffer.append("&o=" + objectId); if (params != null) { for (Map.Entry<String, String> entry : params.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); buffer.append("&" + key + "=" + URLEncoder.encode(value)); } } return buffer.toString(); }
StringTokenizer t = new StringTokenizer(URLEncoder.encodeUri(uri), "/"); if (!t.hasMoreTokens())