if (getLogger().isDebugEnabled()) {
getLogger().debug("Building policy for URL [" + url + "]");
}
DefaultPolicy policy = null;
String policyUri = getPolicySourceURI(url, policyFilename);
if (getLogger().isDebugEnabled()) {
getLogger().debug("Policy source URI resolved to: " + policyUri);
}
try {
PolicyBuilder builder = new PolicyBuilder(controller);
policy = (DefaultPolicy) getCache().get(policyUri, builder);
} catch (CachingException e) {
throw new AccessControlException(e);
}
if (getLogger().isDebugEnabled()) {
getLogger().debug("Policy exists: [" + (policy != null) + "]");
}
if (policy == null) {
policy = new DefaultPolicy();
}
return policy;
}