class LdapGroupAPIController extends SecureLdapController {

    @RequestMapping(value = "/{directory:.+}/groups/{groupName:.+}", method = RequestMethod.DELETE)
    public ResponseEntity<?> deleteLdapGroup(@PathVariable("directory") String directory,
            @PathVariable("groupName") String groupName)
            throws AcmAppErrorJsonMsg
    {
        checkIfLdapManagementIsAllowed(directory);
        try
        {
            groupName = new String(Base64.getUrlDecoder().decode(groupName.getBytes()));
            ldapGroupService.deleteLdapGroup(groupName, directory);
            return new ResponseEntity<>(HttpStatus.OK);
        }
        catch (AcmLdapActionFailedException e)
        {
            throw new AcmAppErrorJsonMsg("Deleting LDAP group failed. Cause: " + e.getMessage(),
                    "LDAP_GROUP", e);
        }
        catch (AcmObjectNotFoundException e)
        {
            throw new AcmAppErrorJsonMsg("Deleting LDAP group failed. Cause: " + e.getCauseMessage(),
                    "LDAP_GROUP", e);
        }
        catch (Exception e)
        {
            throw new AcmAppErrorJsonMsg("Deleting LDAP group failed", "LDAP_GROUP", e);
        }
    }

}