/** * Match the class name against the pattern * * @param name name of the class to match * @return true if class matches the pattern */ public boolean match(String name) { return _patterns.test(name); }
@Deprecated public boolean matches(P t) { return test(t); }
@Override public boolean test(Path path) { if (excludeHidden && isHidden(path)) { if (LOG.isDebugEnabled()) LOG.debug("test({}) -> [Hidden]", toShortPath(path)); return false; } if (!path.startsWith(this.path)) { if (LOG.isDebugEnabled()) LOG.debug("test({}) -> [!child {}]", toShortPath(path), this.path); return false; } if (recurseDepth!=UNLIMITED_DEPTH) { int depth = path.getNameCount() - this.path.getNameCount() - 1; if (depth>recurseDepth) { if (LOG.isDebugEnabled()) LOG.debug("test({}) -> [depth {}>{}]",toShortPath(path),depth,recurseDepth); return false; } } boolean matched = includeExclude.test(path); if (LOG.isDebugEnabled()) LOG.debug("test({}) -> {}", toShortPath(path), matched); return matched; }
/** * Check if specified request is allowed by current IPAccess rules. * * @param address internet address * @return true if address is allowed * */ protected boolean isAllowed(InetAddress address) { return _set.test(address); }
/** * Match the class name against the pattern * * @param name name of the class to match * @return true if class matches the pattern */ public boolean match(String name) { return _patterns.test(name); }
public boolean matches(T t) { return test(t); }
@Deprecated public boolean matches(P t) { return test(t); }
/** * Checks if specified address and request are allowed by current InetAddress rules. * * @param address the inetAddress to check * @param request the request to check * @return true if inetAddress and request are allowed */ protected boolean isAllowed(InetAddress address, HttpServletRequest request) { boolean allowed = _set.test(address); if (LOG.isDebugEnabled()) LOG.debug("{} {} {} for {}", this, allowed ? "allowed" : "denied", address, request); return allowed; }
protected int getThreadLimit(String ip) { if (!_includeExcludeSet.isEmpty()) { try { if (!_includeExcludeSet.test(InetAddress.getByName(ip))) { LOG.debug("excluded {}",ip); return 0; } } catch(Exception e) { LOG.ignore(e); } } return _threadLimit; }
@Override public boolean test(Path path) { if (excludeHidden && isHidden(path)) { if (LOG.isDebugEnabled()) LOG.debug("test({}) -> [Hidden]", toShortPath(path)); return false; } if (!path.startsWith(this.path)) { if (LOG.isDebugEnabled()) LOG.debug("test({}) -> [!child {}]", toShortPath(path), this.path); return false; } if (recurseDepth!=UNLIMITED_DEPTH) { int depth = path.getNameCount() - this.path.getNameCount() - 1; if (depth>recurseDepth) { if (LOG.isDebugEnabled()) LOG.debug("test({}) -> [depth {}>{}]",toShortPath(path),depth,recurseDepth); return false; } } boolean matched = includeExclude.test(path); if (LOG.isDebugEnabled()) LOG.debug("test({}) -> {}", toShortPath(path), matched); return matched; }