/** * Parses a string into an ACL. * * @param serializedForm * the string containing the xml or json formatted access control list. * @return the access control list * @throws IOException * if the encoding is invalid * @throws AccessControlParsingException * if the format is invalid */ public static AccessControlList parseAcl(String serializedForm) throws IOException, AccessControlParsingException { // Determine whether to parse this as XML or JSON if (serializedForm.startsWith("{")) { return parseJson(serializedForm); } else { return parseXml(IOUtils.toInputStream(serializedForm, ENCODING)); } }