- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {OutputStreamWriter o =
OutputStream out;new OutputStreamWriter(out)
OutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
HttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
- Smart code suggestions by Codota
}
@Override public ACL join(ACL acl) { if(acl instanceof RolesACL) { Set<String> newRoles = new HashSet<String>(roles); newRoles.addAll(((RolesACL) acl).getRoles()); return new RolesACL(newRoles); } else if(acl instanceof AdminACL) { Set<String> newRoles = new HashSet<String>(roles); newRoles.add(((AdminACL) acl).getAdminRole()); return new RolesACL(newRoles); } else { return this; } }
/** * Add a roles ACL to the object being build, but only if security was set * in the properties. If the xpath match no roles, the object will have no * ACL set, so it will use it's own default ACL. * * @param object The object to add a role to * @param n The DOM tree where the xpath will look into * @param roleElements the role element */ protected void doACL(WithACL object, JrdsDocument n, JrdsElement roleElements) { if(pm.security) { List<String> roles = new ArrayList<String>(); for(JrdsElement e: roleElements.getChildElementsByName("role")) { roles.add(e.getTextContent()); } if(roles.size() > 0) { object.addACL(new RolesACL(new HashSet<String>(roles))); object.addACL(pm.adminACL); } else { object.addACL(pm.defaultACL); } } }
defaultRoles.add(aRole.trim()); defaultACL = new RolesACL(defaultRoles); defaultACL = defaultACL.join(adminACL);