/** * Escapes backslashes so that they can parse properly. * * @param in - string with backslashes * @return string with backslashes escaped, or null, if passed null */ public static String escapeBackSlashesIfNotNull(String in) { if (in != null) { return StringUtils.replace(in, "\\", "\\\\"); } else { return null; } }
public static String toWindowsPath(final String path) { if (File.separatorChar != '\\' && path.indexOf(File.separatorChar) != -1) { return StringUtils.replace(path, File.separator, "\\"); } return path; }
public static String toUnixPath(final String path) { if (File.separatorChar != '/' && path.indexOf(File.separatorChar) != -1) { return StringUtils.replace(path, File.separator, "/"); } return path; }
private static String processCommon(String template, Pattern pattern, String replacer) { Matcher m = pattern.matcher(template); String noMatchingParts = m.replaceAll(placeholder); String res = StringUtils.replace(noMatchingParts, placeholder, replacer); return res; }
value = StringUtils.replace(value,"<strong>", "<b>"); value = StringUtils.replace(value,"</strong>", "</b>"); value = StringUtils.replace(value,"<em>", "<i>"); value = StringUtils.replace(value,"</em>", "</i>"); value = StringUtils.replace(value, "</HR>", ""); value = StringUtils.replace(value, "</BR>", ""); value = StringUtils.replace(value, "</IMG>", ""); value = StringUtils.replace(value, "<", "&lt;"); value = StringUtils.replace(value, ">", "&gt;");
value = StringUtils.replace(value,"<b>", "<strong>"); value = StringUtils.replace(value,"</b>", "</strong>"); value = StringUtils.replace(value,"<B>", "<strong>"); value = StringUtils.replace(value,"</B>", "</strong>"); value = StringUtils.replace(value,"<i>", "<em>"); value = StringUtils.replace(value,"</i>", "</em>"); value = StringUtils.replace(value,"<I>", "<em>"); value = StringUtils.replace(value,"</I>", "</em>"); value = StringUtils.replace(value,"<u>", "<span style=\"text-decoration: underline;\">"); value = StringUtils.replace(value,"</u>", "</span>"); value = StringUtils.replace(value,"<U>", "<span style=\"text-decoration: underline;\">"); value = StringUtils.replace(value,"</U>", "</span>"); value = StringUtils.replace(value, "</HR>", ""); value = StringUtils.replace(value, "</BR>", ""); value = StringUtils.replace(value, "</IMG>", ""); value = StringUtils.replace(value, "<@WEB@>", "<@WEB@>");