code: private boolean isStatusCodeOK(Response response, String uri) {
  		if (response.getStatus() == Status.OK.getStatusCode()
  				|| response.getStatus() == Status.CREATED.getStatusCode()) {
  			return true;
  		} else if (response.getStatus() == Status.UNAUTHORIZED.getStatusCode()) {
  			throw new NotAuthorizedException("UNAUTHORIZED: Your credentials are wrong. "
  					+ "Please check your username/password or the secret key.", response);
  		} else if (response.getStatus() == Status.CONFLICT.getStatusCode()
  				|| response.getStatus() == Status.NOT_FOUND.getStatusCode()
  				|| response.getStatus() == Status.FORBIDDEN.getStatusCode()
  				|| response.getStatus() == Status.BAD_REQUEST.getStatusCode()) {
  			ErrorResponse errorResponse = response.readEntity(ErrorResponse.class);
  			throw new ClientErrorException(errorResponse.toString(), response);
  		} else {
  			throw new WebApplicationException("Unsupported status", response);
  		}
  	}
docs: Checks if is status code ok.
  
  @param response
  the response
  @param uri
  the uri
  @return true, if is status code ok