/** * Unmarshals an ACL from an xml input stream. * * @param in * the xml input stream * @return the acl * @throws IOException * if there is a problem unmarshaling the stream * @throws AccessControlParsingException * if the format is invalid */ public static AccessControlList parseAcl(InputStream in) throws IOException, AccessControlParsingException { return parseAcl(IOUtils.toString(in, ENCODING)); }
/** Same like {@link #parseAcl(String)} but throws runtime exceptions in case of an error. */ public static AccessControlList parseAclSilent(String serializedForm) { try { return parseAcl(serializedForm); } catch (Exception e) { return chuck(e); } }
@Override public Either<Exception, AccessControlList> apply(String s) { try { return right(parseAcl(s)); } catch (Exception e) { return left(e); } } };