protected Series<org.restlet.engine.header.Header> getRawHeaders() { return getTarget().getHttpCall().getResponseHeaders(); }
/** * Adds the entity headers for the handled uniform call. * * @param response * The response returned. */ protected void addEntityHeaders(HttpResponse response) { Series<Header> responseHeaders = response.getHttpCall() .getResponseHeaders(); Representation entity = response.getEntity(); HeaderUtils.addEntityHeaders(entity, responseHeaders); }
/** * Adds the response headers for the handled uniform call. * * @param response * The response returned. */ protected void addResponseHeaders(HttpResponse response) { try { // Add all the necessary headers HeaderUtils.addGeneralHeaders(response, response.getHttpCall() .getResponseHeaders()); HeaderUtils.addResponseHeaders(response, response.getHttpCall() .getResponseHeaders()); // Set the status code in the response if (response.getStatus() != null) { response.getHttpCall().setStatusCode( response.getStatus().getCode()); response.getHttpCall().setReasonPhrase( response.getStatus().getReasonPhrase()); } } catch (Exception e) { getLogger().log(Level.WARNING, "Exception intercepted while adding the response headers", e); response.getHttpCall().setStatusCode( Status.SERVER_ERROR_INTERNAL.getCode()); response.getHttpCall().setReasonPhrase( Status.SERVER_ERROR_INTERNAL.getReasonPhrase()); } }
if (response.getEntity() != null) { HeaderUtils.addNotModifiedEntityHeaders(response .getEntity(), response.getHttpCall() .getResponseHeaders()); response.setEntity(null); response.getHttpCall().sendResponse(response); } catch (Throwable t) { if (response.getHttpCall().isConnectionBroken(t)) { response.getHttpCall().setStatusCode( Status.SERVER_ERROR_INTERNAL.getCode()); response.getHttpCall().setReasonPhrase( "An exception occurred writing the response entity"); response.setEntity(null); response.getHttpCall().sendResponse(response); } catch (IOException ioe) { getLogger().log(Level.WARNING, response.getHttpCall().complete();