fireContentChanged();
}
private DocumentContent extractContentFrom(HttpResponse response, Format format) {
if (response == null) {
return new DocumentContent(null, null);
} else {
String contentAsString;
if (format == Format.XML) {
contentAsString = MediaTypeHandlerRegistry.getTypeHandler(response.getContentType()).createXmlRepresentation(response);
} else {
contentAsString = response.getContentAsString();
}
return new DocumentContent(response.getContentType(), contentAsString);
}
}