@Test public void test_encodedURL_with_special_char() throws UnsupportedEncodingException { String url = "http: String result = StringUtil.urlEncode(url); assertEquals("http: }
public static String urlEncode(String str) { if (StringUtils.isBlank(str)) { return str; } String result = str; try { UriComponents uriComponents = UriComponentsBuilder.fromUriString(str).build(); return uriComponents.encode().toUriString(); } catch (Exception e) { LOGGER.error(e.getMessage()); } return result; }
StringUtil { public static String urlEncode(String str) { if (StringUtils.isBlank(str)) { return str; } String result = str; try { UriComponents uriComponents = UriComponentsBuilder.fromUriString(str).build(); return uriComponents.encode().toUriString(); } catch (Exception e) { LOGGER.error(e.getMessage()); } return result; } }
StringUtil { public static String urlEncode(String str) { if (StringUtils.isBlank(str)) { return str; } String result = str; try { UriComponents uriComponents = UriComponentsBuilder.fromUriString(str).build(); return uriComponents.encode().toUriString(); } catch (Exception e) { LOGGER.error(e.getMessage()); } return result; } private  StringUtil(); }
StringUtil { public static String urlEncode(String str) { if (StringUtils.isBlank(str)) { return str; } String result = str; try { UriComponents uriComponents = UriComponentsBuilder.fromUriString(str).build(); return uriComponents.encode().toUriString(); } catch (Exception e) { LOGGER.error(e.getMessage()); } return result; } private  StringUtil(); static List<MediaType> parseMediaTypes(String mediaTypesStr); static MediaType parseMediaType(String mediaTypeStr); static boolean containNonAsciiPrintableChars(String decodeUri); static String generateEncodedRedirectURL(String param,
            String servicePartUri, String baseUrl); static List<String> parseSeparatedStringToListIfListIsNull(
            String separatedStr, List<String> list); static String addQuotas(String str); static boolean checkIsValidSearchPattern(String str); static boolean containsAtMostOnce(String str, String searchStr); static boolean isValidEntityHandleOrName(String handle); static String urlEncode(String str); static String getNormalization(String str); static long parseUnsignedLong(String s); static String foldCase(String strParam); static String foldCaseAndNormalization(String strParam); static List<String> getNotEmptyStringList(List<String> stringList); }
StringUtil { public static String urlEncode(String str) { if (StringUtils.isBlank(str)) { return str; } String result = str; try { UriComponents uriComponents = UriComponentsBuilder.fromUriString(str).build(); return uriComponents.encode().toUriString(); } catch (Exception e) { LOGGER.error(e.getMessage()); } return result; } private  StringUtil(); static List<MediaType> parseMediaTypes(String mediaTypesStr); static MediaType parseMediaType(String mediaTypeStr); static boolean containNonAsciiPrintableChars(String decodeUri); static String generateEncodedRedirectURL(String param,
            String servicePartUri, String baseUrl); static List<String> parseSeparatedStringToListIfListIsNull(
            String separatedStr, List<String> list); static String addQuotas(String str); static boolean checkIsValidSearchPattern(String str); static boolean containsAtMostOnce(String str, String searchStr); static boolean isValidEntityHandleOrName(String handle); static String urlEncode(String str); static String getNormalization(String str); static long parseUnsignedLong(String s); static String foldCase(String strParam); static String foldCaseAndNormalization(String strParam); static List<String> getNotEmptyStringList(List<String> stringList); static final String SPACE; static final String TLD_SPLITOR; static final String ASTERISK; static final String CHAR_SET_UTF8; static final String CHAR_SET_ISO8859; static final int MAX_ENTITY_HANDLE_LENGTH; }