--- experimental/server/ACL/ACL.java 2001/12/23 01:05:35 1.5 +++ experimental/server/ACL/ACL.java 2001/12/24 04:17:29 1.6 @@ -16,7 +16,7 @@ import java.io.Serializable; * the relevant check method. * * @author $Author: tdb $ - * @version $Id: ACL.java,v 1.5 2001/12/23 01:05:35 tdb Exp $ + * @version $Id: ACL.java,v 1.6 2001/12/24 04:17:29 tdb Exp $ */ public class ACL implements Serializable { @@ -25,7 +25,7 @@ public class ACL implements Serializable { /** * The current CVS revision of this class */ - public static final String REVISION = "$Revision: 1.5 $"; + public static final String REVISION = "$Revision: 1.6 $"; /** * static to be used when adding an ALLOW rule to the ACL. @@ -129,13 +129,7 @@ public class ACL implements Serializable { StringBuffer acl = new StringBuffer(); acl.append("{"); for(int i=0; i < _acl.size(); i++) { - ACLRule rule = (ACLRule) _acl.get(i); - if(rule._allow) { - acl.append(rule._expression + "=ALLOW"); - } - else { - acl.append(rule._expression + "=DENY"); - } + acl.append((ACLRule) _acl.get(i)); acl.append(","); } if(_defaultMode) { @@ -193,6 +187,20 @@ public class ACL implements Serializable { private ACLRule(boolean allow, String expression) { _allow = allow; _expression = expression; + } + + /** + * Returns a String representation of this rule. + * + * @return A String representation of this rule. + */ + public String toString() { + if(_allow) { + return _expression + "=ALLOW"; + } + else { + return _expression + "=DENY"; + } } /**