class RestUserController {

    @ResponseStatus(HttpStatus.NO_CONTENT)
    @RequestMapping(value = "/users/{$username}", method = RequestMethod.DELETE)
    public void delete(@PathVariable("$username") String username) throws UserException {
        User user = userService.get(username);
        if (user == null ) {
            throw new UserException("No user found for username " + username);
        }
        userService.remove(username);
    }

}