charset = null;
transportHeaders = null;
content = null;
} else {
//
ContentResponse piResponse = (ContentResponse) portletResponse;
ResponseProperties properties = piResponse.getProperties();
transportHeaders = properties != null ? properties.getTransportHeaders() : null;
// Look at status code if there is one and honour it
String status = transportHeaders != null ? transportHeaders.getValue(ResourceResponse.HTTP_STATUS_CODE)
: null;
if (status != null) {
try {
statusCode = Integer.parseInt(status);
} catch (NumberFormatException e) {
statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
}
} else {
statusCode = HttpServletResponse.SC_OK;
}
//
contentType = piResponse.getContentType();
charset = piResponse.getEncoding();
//
log.trace("Try to get a resource of type: " + contentType + " for the portlet: "
+ uiPortlet.getId());
if (piResponse.getChars() != null) {
content = piResponse.getChars();
} else if (piResponse.getBytes() != null) {
content = piResponse.getBytes();
} else {
content = null;
}
}