@Provider public class UserNotFoundMapper implements ExceptionMapper<UserNotFoundException> { @Override public Response toResponse(UserNotFoundException ex) { return Response.status(404).entity(ex.getMessage()).type("text/plain") .build(); } }
@Provider public class UserNotFoundMapper implements ExceptionMapper<UserNotFoundException> { @Override public Response toResponse(UserNotFoundException ex) { return Response.status(404).entity(ex.getMessage()).type("text/plain") .build(); } }
@Provider public class UserNotFoundMapper implements ExceptionMapper<UserNotFoundException> { @Override public Response toResponse(UserNotFoundException e) { return Response.status(404).entity(e.getMessage()).type("text/plain").build(); } }
log.error( e.getMessage(), e ); throw new RedbackServiceException( e.getMessage() );
log.info( "user {} not found", e.getMessage() ); List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>( 2 ); ErrorMessage errorMessage = new ErrorMessage( "cannot.update.user.not.found", new String[]{ principal } );
log.info( "user {} not found", e.getMessage() ); List<ErrorMessage> errorMessages = new ArrayList<ErrorMessage>( 2 ); ErrorMessage errorMessage = new ErrorMessage( "cannot.update.user.not.found", new String[]{ principal } );
log.error( e.getMessage(), e ); throw new RedbackServiceException( e.getMessage() );
throw new RedbackServiceException( e.getMessage() );
new ErrorMessage( "user.does.not.exist", new String[]{ username, e.getMessage() } ) );
throw new UnauthorizedException( e.getMessage(), e );
throw new UnauthorizedException( e.getMessage(), e );
throw new RedbackServiceException( e.getMessage() );
new ErrorMessage( "user.does.not.exist", new String[]{ username, e.getMessage() } ) );
public Boolean updateUser( User user ) throws RedbackServiceException { try { org.apache.archiva.redback.users.User rawUser = userManager.findUser( user.getUsername(), false ); rawUser.setFullName( user.getFullName() ); rawUser.setEmail( user.getEmail() ); rawUser.setValidated( user.isValidated() ); rawUser.setLocked( user.isLocked() ); rawUser.setPassword( user.getPassword() ); rawUser.setPasswordChangeRequired( user.isPasswordChangeRequired() ); rawUser.setPermanent( user.isPermanent() ); userManager.updateUser( rawUser ); return Boolean.TRUE; } catch ( UserNotFoundException e ) { throw new RedbackServiceException( e.getMessage() ); } catch ( UserManagerException e ) { throw new RedbackServiceException( new ErrorMessage( e.getMessage() ) ); } }