@Override public Object getEntity() { return !jaxrsResponse.isClosed() ? jaxrsResponse.getEntity() : null; }
public ServerResponse(final BuiltResponse response) { this.setEntity(response.getEntity()); this.setAnnotations(response.getAnnotations()); this.setStatus(response.getStatus()); this.setMetadata(response.getMetadata()); this.setEntityClass(response.getEntityClass()); this.setGenericType(response.getGenericType()); this.setReasonPhrase(response.getReasonPhrase()); } }
@Override public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } //Check if the entity was previously fully consumed if (streamFullyRead && bufferedEntity == null) { throw new IllegalStateException(); } return getEntityStream(); }
Object ent = jaxrsResponse.getEntity(); Type generic = jaxrsResponse.getGenericType(); if (generic == null)
public static MediaType getResponseMediaType(BuiltResponse jaxrsResponse, HttpRequest request, HttpResponse response, ResteasyProviderFactory providerFactory, ResourceMethodInvoker method) { MediaType mt = null; if (!jaxrsResponse.isClosed() && jaxrsResponse.getEntity() != null) { if ((mt = jaxrsResponse.getMediaType()) == null) { mt = getDefaultContentType(request, jaxrsResponse, providerFactory, method); } boolean addCharset = true; ResteasyDeployment deployment = ResteasyContext.getContextData(ResteasyDeployment.class); if (deployment != null) { addCharset = deployment.isAddCharset(); } if (addCharset) { if (!mt.getParameters().containsKey(MediaType.CHARSET_PARAMETER)) { if (MediaTypeHelper.isTextLike(mt)) { mt = mt.withCharset(StandardCharsets.UTF_8.toString()); } } } } return mt; }
Object entity = jaxrsResponse.isClosed() ? null : jaxrsResponse.getEntity();
@Override public Object getEntity() { return jaxrsResponse.getEntity(); }
public ServerResponse(final BuiltResponse response) { this.setEntity(response.getEntity()); this.setAnnotations(response.getAnnotations()); this.setStatus(response.getStatus()); this.setMetadata(response.getMetadata()); this.setEntityClass(response.getEntityClass()); this.setGenericType(response.getGenericType()); this.setReasonPhrase(response.getReasonPhrase()); } }
@Override public Object getEntity() { if (error!=null) { throw new IllegalStateException("getEntity called on BuiltResponsePreservingError, where an Error had been preserved", error); } return super.getEntity(); }
OutboundSseEvent event = sse.newEventBuilder() .mediaType(builtResponse.getMediaType()) .data(builtResponse.getEntityClass(), builtResponse.getEntity()) .build(); sendingEvent = true;
Object entity = jaxrsResponse.getEntity(); if (entity instanceof ModelAndView)
@Override public Object getEntity() { return !jaxrsResponse.isClosed() ? jaxrsResponse.getEntity() : null; }
public ServerResponse(BuiltResponse response) { this.setEntity(response.getEntity()); this.setAnnotations(response.getAnnotations()); this.setStatus(response.getStatus()); this.setMetadata(response.getMetadata()); this.setEntityClass(response.getEntityClass()); this.setGenericType(response.getGenericType()); this.setReasonPhrase(response.getReasonPhrase()); } }
@Override public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } //Check if the entity was previously fully consumed if (streamFullyRead && bufferedEntity == null) { throw new IllegalStateException(); } return getEntityStream(); }
@Override public synchronized Object getEntity() { abortIfClosed(); Object entity = super.getEntity(); if (entity != null) { return entity; } //Check if the entity was previously fully consumed if (streamFullyRead && bufferedEntity == null) { throw new IllegalStateException(); } return getEntityStream(); }
public static void setResponseMediaType(BuiltResponse jaxrsResponse, HttpRequest request, HttpResponse response, ResteasyProviderFactory providerFactory, ResourceMethodInvoker method) if (jaxrsResponse.getEntity() != null)
public static MediaType getResponseMediaType(BuiltResponse jaxrsResponse, HttpRequest request, HttpResponse response, ResteasyProviderFactory providerFactory, ResourceMethodInvoker method) { MediaType mt = null; if (!jaxrsResponse.isClosed() && jaxrsResponse.getEntity() != null) { if ((mt = jaxrsResponse.getMediaType()) == null) { mt = getDefaultContentType(request, jaxrsResponse, providerFactory, method); } boolean addCharset = true; ResteasyDeployment deployment = ResteasyContext.getContextData(ResteasyDeployment.class); if (deployment != null) { addCharset = deployment.isAddCharset(); } if (addCharset) { if (!mt.getParameters().containsKey(MediaType.CHARSET_PARAMETER)) { if (MediaTypeHelper.isTextLike(mt)) { mt = mt.withCharset(StandardCharsets.UTF_8.toString()); } } } } return mt; }