* PROPERTIES
*/
- /** Concisely get the string value of a property */
+ /**
+ * Concisely get the string value of a property or null if this node doesn't
+ * have this property
+ */
public static String get(Node node, String propertyName) {
try {
+ if (!node.hasProperty(propertyName))
+ return null;
return node.getProperty(propertyName).getString();
} catch (RepositoryException e) {
throw new ArgeoException("Cannot get property " + propertyName
/**
* Add privileges on a path to a {@link Principal}. The path must already
- * exist.
+ * exist. Session is saved.
*/
public static void addPrivileges(Session session, String path,
Principal principal, List<Privilege> privs)
throw new ArgeoException("Don't know how to apply privileges "
+ privs + " to " + principal + " on " + path);
}
+ session.save();
}
}