class RangerDefaultResourceMatcher extends RangerAbstractResourceMatcher {

	@Override
	public boolean isMatch(String resource) {
		if(LOG.isDebugEnabled()) {
			LOG.debug("==> RangerDefaultResourceMatcher.isMatch(" + resource + ")");
		}

		boolean ret = false;
		boolean allValuesRequested = isAllValuesRequested(resource);

		if(allValuesRequested || isMatchAny) {
			ret = isMatchAny;
		} else {
			for(String policyValue : policyValues) {
				if(optWildCard) {
					ret = optIgnoreCase ? FilenameUtils.wildcardMatch(resource, policyValue, IOCase.INSENSITIVE)
										: FilenameUtils.wildcardMatch(resource, policyValue, IOCase.SENSITIVE);
				} else {
					ret = optIgnoreCase ? StringUtils.equalsIgnoreCase(resource, policyValue)
										: StringUtils.equals(resource, policyValue);
				}

				if(ret) {
					break;
				}
			}
		}

		ret = applyExcludes(allValuesRequested, ret);

		if(LOG.isDebugEnabled()) {
			LOG.debug("<== RangerDefaultResourceMatcher.isMatch(" + resource + "): " + ret);
		}

		return ret;
	}

}