| 121 |
|
} |
| 122 |
|
|
| 123 |
|
/** |
| 124 |
< |
* Gets the ACL as a String for debugging. |
| 124 |
> |
* Gives a String representation of this ACL. |
| 125 |
|
* |
| 126 |
|
* @return A String representation of this ACL. |
| 127 |
|
*/ |
| 128 |
< |
public String getStringACL() { |
| 129 |
< |
String acl = ""; |
| 128 |
> |
public String toString() { |
| 129 |
> |
StringBuffer acl = new StringBuffer(); |
| 130 |
> |
acl.append("{"); |
| 131 |
|
for(int i=0; i < _acl.size(); i++) { |
| 132 |
|
ACLRule rule = (ACLRule) _acl.get(i); |
| 133 |
|
if(rule._allow) { |
| 134 |
< |
acl += "ALLOW:" + rule._expression + " "; |
| 134 |
> |
acl.append(rule._expression + "=ALLOW"); |
| 135 |
|
} |
| 136 |
|
else { |
| 137 |
< |
acl += "DENY:" + rule._expression + " "; |
| 137 |
> |
acl.append(rule._expression + "=DENY"); |
| 138 |
|
} |
| 139 |
+ |
acl.append(","); |
| 140 |
|
} |
| 141 |
|
if(_defaultMode) { |
| 142 |
< |
acl += "DEFAULT:ALLOW"; |
| 142 |
> |
acl.append("DEFAULT=ALLOW"); |
| 143 |
|
} |
| 144 |
|
else { |
| 145 |
< |
acl += "DEFAULT:DENY"; |
| 145 |
> |
acl.append("DEFAULT=DENY"); |
| 146 |
|
} |
| 147 |
< |
return acl; |
| 148 |
< |
} |
| 147 |
< |
|
| 148 |
< |
/** |
| 149 |
< |
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
| 150 |
< |
* method to provide clean logging (every class should have this). |
| 151 |
< |
* |
| 152 |
< |
* This uses the uk.org.iscream.cms.server.util.FormatName class |
| 153 |
< |
* to format the toString() |
| 154 |
< |
* |
| 155 |
< |
* @return the name of this class and its CVS revision |
| 156 |
< |
*/ |
| 157 |
< |
public String toString() { |
| 158 |
< |
return FormatName.getName( |
| 159 |
< |
_name, |
| 160 |
< |
getClass().getName(), |
| 161 |
< |
REVISION); |
| 147 |
> |
acl.append("}"); |
| 148 |
> |
return acl.toString(); |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
//---PRIVATE METHODS--- |