protected String encode(String string) { return JiraUrlCodec.encode(string, true); }
String keyValuePair = JiraUrlCodec.decode(rawKeyValuePair, "UTF-8"); if (StringUtils.isNotBlank(keyValuePair))
/** * URL encode the passed value using the passed character encoding, or if the encoding doesn't exist, the system * encoding. * * @param value the value to encode. * @param encoding the character encoding to use * @param spacesEncodedasHexValue if true spaces are encoded with the the hex value '%20', otherwise if false then the character '+'. * @return the encoded value. */ @HtmlSafe public static String encode(String value, String encoding, boolean spacesEncodedasHexValue) { try { return URLCodec.encode(value, encoding, spacesEncodedasHexValue); } catch (UnsupportedEncodingException e) { log.warn("Unable to encode '" + value + "' with encoding '" + encoding + "'. Encoding with system defaults."); return systemDefaultEncoding(value, spacesEncodedasHexValue); } }
bodyParams.put("remoteUser", user); bodyParams.put("stringUtils", new StringUtils()); bodyParams.put("encoder", new JiraUrlCodec()); if (timeTrackingEnabled && subTasksEnabled && !issue.isSubTask())
private String encode(final String key) { return JiraUrlCodec.encode(key); }
/** * URL decode the passed value using the configured JIRA character encoding, or if the encoding doesn't exist, * the system encoding. * * @param value the value to decode. * @return the decoded value. */ public static String decode(String value) { return decode(value, ComponentAccessor.getApplicationProperties().getEncoding()); }
public String getUrlEncoded(final String s) { return JiraUrlCodec.encode(s); }
@VisibleForTesting String getJiraUrlEncoded(String user) { return JiraUrlCodec.encode(user); } }
/** * URL encode the string representation of passed object. * * @param input the object whose string representation is to be escaped. * @return the URL encoded version of the passed object's string representation. */ String urlenc(final Object input) { if (input == null) { return ""; } return JiraUrlCodec.encode(input.toString()); }
private String viewUserUrl() { return "ViewUser.jspa?name=" + JiraUrlCodec.encode(username.toLowerCase()); }
@Nonnull private String urlEncode(@Nonnull final String string) { return JiraUrlCodec.encode(string); } }
private StringBuilder appendParameter(StringBuilder builder, final String param, final String value) { return builder.append("&").append(param).append("=").append(JiraUrlCodec.encode(value)); }
private String getDestinationUrl(HttpServletRequest httpServletRequest) { return JiraUrlCodec.encode ( httpServletRequest.getServletPath() + (httpServletRequest.getPathInfo() == null ? "" : httpServletRequest.getPathInfo()) + (httpServletRequest.getQueryString() == null ? "" : "?" + httpServletRequest.getQueryString()) ); }
/** * URL encode the passed value using the configured JIRA character encoding, or if the encoding doesn't exist, * the system encoding. Spaces are encoded as the '+' character. * * @param value the value to encode. * @return the encoded value. */ @HtmlSafe public static String encode(String value) { return encode(value, false); }
private String encode(final String searchString) { // we call this so that the static ComponentAccessor is not used and we are not detestible return JiraUrlCodec.encode(searchString, applicationProperties.getEncoding(), true); }
private void setContentDispositionOnResponse(HttpServletResponse httpServletResponse, String filename, String contentDisposition) { String filenameEncoding = applicationProperties.getEncoding(); // note the special *= syntax is used for embedding the encoding that the filename is in as per RFC 2231 // http://www.faqs.org/rfcs/rfc2231.html httpServletResponse.setHeader("Content-Disposition", String.format("%s; filename*=%s''%s;", contentDisposition, filenameEncoding, JiraUrlCodec.encode(filename, true))); }
/** * URL encode the passed value using the passed character encoding, or if the encoding doesn't exist, the system * encoding. Spaces are encoded as the '+' character. * * @param value the value to encode. * @param encoding the character encoding to use * @return the encoded value. */ @HtmlSafe public static String encode(String value, String encoding) { return encode(value, encoding, false); }
public static URI makeSelfUri(String groupName, JiraBaseUrls urls) { return URI.create(urls.restApi2BaseUrl() + "group?groupname=" + JiraUrlCodec.encode(groupName)); }
/** * Creates new instance of GroupJsonBean for docummentation usage. * @param name group name * @return GroupJsonBean with name and self uri. */ public static GroupJsonBean BuildDocExampleUsers(String name) { return new GroupJsonBean(name, URI.create("http://www.example.com/jira/rest/api/2/group?groupname=" + JiraUrlCodec.encode(name, "utf8"))); } }