You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2003/10/02 17:29:46 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/ac2/file FilePolicyManager.java
andreas 2003/10/02 08:29:46
Modified: src/java/org/apache/lenya/cms/ac2/file
FilePolicyManager.java
Log:
debug messages only when isDebugEnabled()
Revision Changes Path
1.18 +18 -12 cocoon-lenya/src/java/org/apache/lenya/cms/ac2/file/FilePolicyManager.java
Index: FilePolicyManager.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/ac2/file/FilePolicyManager.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- FilePolicyManager.java 28 Aug 2003 10:06:03 -0000 1.17
+++ FilePolicyManager.java 2 Oct 2003 15:29:46 -0000 1.18
@@ -120,7 +120,7 @@
private SourceResolver resolver;
private SourceCache cache;
-
+
protected static final String URL_FILENAME = "url-policy.acml";
protected static final String SUBTREE_FILENAME = "subtree-policy.acml";
@@ -163,12 +163,16 @@
String policyFilename)
throws AccessControlException {
- getLogger().debug("Building policy for URL [" + url + "]");
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Building policy for URL [" + url + "]");
+ }
DefaultPolicy policy = null;
String policyUri = getPolicyURI(url, policyFilename);
- getLogger().debug("Policy source URI resolved to: " + policyUri);
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Policy source URI resolved to: " + policyUri);
+ }
try {
PolicyBuilder builder = new PolicyBuilder(controller);
@@ -176,11 +180,12 @@
} catch (CachingException e) {
throw new AccessControlException(e);
}
-
- if (policy != null) {
- getLogger().debug("Policy found.");
- } else {
- getLogger().debug("Using empty Policy.");
+
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Policy exists: [" + (policy != null) + "]");
+ }
+
+ if (policy == null) {
policy = new DefaultPolicy();
}
return policy;
@@ -242,10 +247,11 @@
if (url.startsWith("/")) {
url = url.substring(1);
}
-
- String policyUri = "file://" + getPoliciesDirectory().getAbsolutePath() + "/" + url + "/" + policyFilename;
+
+ String policyUri =
+ "file://" + getPoliciesDirectory().getAbsolutePath() + "/" + url + "/" + policyFilename;
getLogger().debug("Computing policy URI [" + policyUri + "]");
- return policyUri;
+ return policyUri;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org