--- experimental/server/ACL/ACL.java 2001/12/23 00:29:33 1.4 +++ experimental/server/ACL/ACL.java 2001/12/23 01:05:35 1.5 @@ -16,7 +16,7 @@ import java.io.Serializable; * the relevant check method. * * @author $Author: tdb $ - * @version $Id: ACL.java,v 1.4 2001/12/23 00:29:33 tdb Exp $ + * @version $Id: ACL.java,v 1.5 2001/12/23 01:05:35 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.4 $"; + public static final String REVISION = "$Revision: 1.5 $"; /** * static to be used when adding an ALLOW rule to the ACL. @@ -121,44 +121,31 @@ public class ACL implements Serializable { } /** - * Gets the ACL as a String for debugging. + * Gives a String representation of this ACL. * * @return A String representation of this ACL. */ - public String getStringACL() { - String acl = ""; + public String toString() { + StringBuffer acl = new StringBuffer(); + acl.append("{"); for(int i=0; i < _acl.size(); i++) { ACLRule rule = (ACLRule) _acl.get(i); if(rule._allow) { - acl += "ALLOW:" + rule._expression + " "; + acl.append(rule._expression + "=ALLOW"); } else { - acl += "DENY:" + rule._expression + " "; + acl.append(rule._expression + "=DENY"); } + acl.append(","); } if(_defaultMode) { - acl += "DEFAULT:ALLOW"; + acl.append("DEFAULT=ALLOW"); } else { - acl += "DEFAULT:DENY"; + acl.append("DEFAULT=DENY"); } - return acl; - } - - /** - * Overrides the {@link java.lang.Object#toString() Object.toString()} - * method to provide clean logging (every class should have this). - * - * This uses the uk.org.iscream.cms.server.util.FormatName class - * to format the toString() - * - * @return the name of this class and its CVS revision - */ - public String toString() { - return FormatName.getName( - _name, - getClass().getName(), - REVISION); + acl.append("}"); + return acl.toString(); } //---PRIVATE METHODS---