boolean negative = false;
Principal principal = null;
List permissions = new ArrayList();
Acl acl = new Acl(owner, name);
int PERMISSIONS = 1;
int PRINCIPAL = 2;
int state = PRINCIPAL;
for (StringTokenizer stringTokenizer = new StringTokenizer(input, " \n{}", true);
stringTokenizer.hasMoreTokens();) {
String t = stringTokenizer.nextToken();
if (" ".equals(t) || "\n".equals(t)) {
// do nothing
} else if ("{".equals(t)) {
state = PERMISSIONS;
} else if ("}".equals(t)) {
state = PRINCIPAL;
AclEntry entry = new AclEntry(principal);
Iterator iterator = permissions.iterator();
while (iterator.hasNext()) {
Permission permission = (Permission) iterator.next();
entry.addPermission(permission);
}
if (negative) {
entry.setNegativePermissions();
negative = false;
}
acl.addEntry(owner, entry);
permissions = new ArrayList();
principal = null;
} else if (state == PRINCIPAL) {
if (t.startsWith("-")) {
negative = true;