Package io.dropwizard.jersey.errors

Examples of io.dropwizard.jersey.errors.ErrorMessage


    String authHeader = request.getHeader(AuthUtils.AUTH_HEADER_KEY);
    if (StringUtils.isNotBlank(authHeader)) {
      if (user.isPresent()) {
        return Response
            .status(Status.CONFLICT)
            .entity(new ErrorMessage(String.format(CONFLICT_MSG, provider.capitalize())))
            .build();
      }

      String subject = AuthUtils.getSubject(authHeader);
      Optional<User> foundUser = dao.findById(Long.parseLong(subject));
      if (!foundUser.isPresent()) {
        return Response.status(Status.NOT_FOUND).entity(new ErrorMessage(NOT_FOUND_MSG))
            .build();
      }

      userToSave = foundUser.get();
      userToSave.setProviderId(provider, id);
View Full Code Here

TOP

Related Classes of io.dropwizard.jersey.errors.ErrorMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.