/** * Return true if the <b>match</b> field contains a regex that matches some * or all of the given URL, false if no match is found. */ public boolean matches(final String url) { if (url != null) { if (getMatch().length() == 0) { return true; } else { Matcher m = pattern.matcher(url).useAnchoringBounds(outbound); while (m.find()) { return true; } } } return false; }
/** * Return true if the <b>match</b> field contains a regex that matches some * or all of the given URL, false if no match is found. */ public boolean matches(final String url) { if (url != null) { if (getMatch().length() == 0) { return true; } else { Matcher m = pattern.matcher(url).useAnchoringBounds(outbound); while (m.find()) { return true; } } } return false; }
/** * Return true if the <b>match</b> field contains a regex that matches some * or all of the given URL, false if no match is found. */ public boolean matches(final String url) { if (url != null) { if (getMatch().length() == 0) { return true; } else { Matcher m = pattern.matcher(url).useAnchoringBounds(outbound); while (m.find()) { return true; } } } return false; }
/** * Return true if the <b>match</b> field contains a regex that matches some * or all of the given URL, false if no match is found. */ public boolean matches(final String url) { if (url != null) { if (getMatch().length() == 0) { return true; } else { Matcher m = pattern.matcher(url).useAnchoringBounds(outbound); while (m.find()) { return true; } } } return false; }
private String process(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { if ((url == null) || (rule.getUrl().length() == 0)) { return url; } String result = url; if (rule.getMatch().length() > 0) { result = url.replaceAll(rule.getMatch(), rule.getUrl()); } else { result = rule.getUrl(); } return result; }
private String process(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { if ((url == null) || (rule.getMatch().length() == 0) || (rule.getSubstitute().length() == 0)) { return url; } Matcher m = rule.getPattern().matcher(url); StringBuffer result = new StringBuffer(); while (m.find()) { m.appendReplacement(result, rule.getSubstitute()); } m.appendTail(result); return result.toString(); }
private String process(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { if ((url == null) || (rule.getMatch().length() == 0) || (rule.getSubstitute().length() == 0)) { return url; } Matcher m = rule.getPattern().matcher(url); StringBuffer result = new StringBuffer(); while (m.find()) { m.appendReplacement(result, rule.getSubstitute()); } m.appendTail(result); return result.toString(); }
private String process(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { if ((url == null) || (rule.getUrl().length() == 0)) { return url; } String result = url; if (rule.getMatch().length() > 0) { result = url.replaceAll(rule.getMatch(), rule.getUrl()); } else { result = rule.getUrl(); } return result; }
private String process(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { if ((url == null) || (rule.getUrl().length() == 0)) { return url; } String result = url; if (rule.getMatch().length() > 0) { result = url.replaceAll(rule.getMatch(), rule.getUrl()); } else { result = rule.getUrl(); } return result; }
private String process(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { if ((url == null) || (rule.getMatch().length() == 0) || (rule.getSubstitute().length() == 0)) { return url; } Matcher m = rule.getPattern().matcher(url); StringBuffer result = new StringBuffer(); while (m.find()) { m.appendReplacement(result, rule.getSubstitute()); } m.appendTail(result); return result.toString(); }
private String process(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { if ((url == null) || (rule.getMatch().length() == 0) || (rule.getSubstitute().length() == 0)) { return url; } Matcher m = rule.getPattern().matcher(url); StringBuffer result = new StringBuffer(); while (m.find()) { m.appendReplacement(result, rule.getSubstitute()); } m.appendTail(result); return result.toString(); }
private String process(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { if ((url == null) || (rule.getUrl().length() == 0)) { return url; } String result = url; if (rule.getMatch().length() > 0) { result = url.replaceAll(rule.getMatch(), rule.getUrl()); } else { result = rule.getUrl(); } return result; }