{
LDAPGroup ldapGroup = null;
if(groupExists(group.getName()))
{
throw new GroupException("The group '" +
group.getName() + "' already exists");
}
try
{
ldapGroup = new LDAPGroup(group.getName(), true);
ldapGroup.update(true);
}
catch(Exception e)
{
throw new GroupException("Failed to create group '" +
group.getName() + "'", e);
}
try
{
addDefaultGroupPSML(ldapGroup);
}
catch (Exception e)
{
try
{
removeGroup(ldapGroup.getName());
}
catch (Exception e2)
{
}
throw new GroupException("failed to add default PSML for Group resource", e);
}
}