@Override public boolean isProtectedTarget(String target) { // Fixes PAXWEB-196 and PAXWEB-211 //CHECKSTYLE:OFF while (target.startsWith("//")) { target = URIUtil.compactPath(target); } //CHECKSTYLE:ON return StringUtil.startsWithIgnoreCase(target, "/web-inf") || StringUtil.startsWithIgnoreCase(target, "/meta-inf") || StringUtil.startsWithIgnoreCase(target, "/osgi-inf") || StringUtil.startsWithIgnoreCase(target, "/osgi-opt"); }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. */ /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); boolean isProtected = false; int i=0; while (!isProtected && i<_protectedTargets.length) { isProtected = StringUtil.startsWithIgnoreCase(target, _protectedTargets[i++]); } return isProtected; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. */ /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); boolean isProtected = false; int i=0; while (!isProtected && i<_protectedTargets.length) { isProtected = StringUtil.startsWithIgnoreCase(target, _protectedTargets[i++]); } return isProtected; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. */ /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); boolean isProtected = false; int i=0; while (!isProtected && i<_protectedTargets.length) { isProtected = StringUtil.startsWithIgnoreCase(target, _protectedTargets[i++]); } return isProtected; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. */ /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); boolean isProtected = false; int i=0; while (!isProtected && i<_protectedTargets.length) { isProtected = StringUtil.startsWithIgnoreCase(target, _protectedTargets[i++]); } return isProtected; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. */ /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); boolean isProtected = false; int i=0; while (!isProtected && i<_protectedTargets.length) { isProtected = StringUtil.startsWithIgnoreCase(target, _protectedTargets[i++]); } return isProtected; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. */ /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); boolean isProtected = false; int i=0; while (!isProtected && i<_protectedTargets.length) { isProtected = StringUtil.startsWithIgnoreCase(target, _protectedTargets[i++]); } return isProtected; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. */ /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); boolean isProtected = false; int i=0; while (!isProtected && i<_protectedTargets.length) { isProtected = StringUtil.startsWithIgnoreCase(target, _protectedTargets[i++]); } return isProtected; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. */ /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); for (int i=0; i<_protectedTargets.length; i++) { String t=_protectedTargets[i]; if (StringUtil.startsWithIgnoreCase(target,t)) { if (target.length()==t.length()) return true; // Check that the target prefix really is a path segment, thus // it can end with /, a query, a target or a parameter char c=target.charAt(t.length()); if (c=='/'||c=='?'||c=='#'||c==';') return true; } } return false; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. * @param target the target to test * @return true if target is a protected target */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target=URIUtil.compactPath(target); for (int i=0; i<_protectedTargets.length; i++) { String t=_protectedTargets[i]; if (StringUtil.startsWithIgnoreCase(target,t)) { if (target.length()==t.length()) return true; // Check that the target prefix really is a path segment, thus // it can end with /, a query, a target or a parameter char c=target.charAt(t.length()); if (c=='/'||c=='?'||c=='#'||c==';') return true; } } return false; }
/** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. * * @param target * the target to test * @return true if target is a protected target */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) return false; while (target.startsWith("//")) target = URIUtil.compactPath(target); for (int i = 0; i < _protectedTargets.length; i++) { String t = _protectedTargets[i]; if (StringUtil.startsWithIgnoreCase(target,t)) { if (target.length() == t.length()) return true; // Check that the target prefix really is a path segment, thus // it can end with /, a query, a target or a parameter char c = target.charAt(t.length()); if (c == '/' || c == '?' || c == '#' || c == ';') return true; } } return false; }