NIFI-1835 - added text/xml to content viewer

Signed-off-by: Scott Aslan <scottyaslan@gmail.com>

This closes #2098
This commit is contained in:
Pierre Villard 2017-08-16 18:30:20 +02:00 committed by Scott Aslan
parent 0bcb19771f
commit 41984bed13
2 changed files with 3 additions and 1 deletions

View File

@ -53,6 +53,7 @@ public class StandardContentViewerController extends HttpServlet {
static { static {
supportedMimeTypes.add("application/json"); supportedMimeTypes.add("application/json");
supportedMimeTypes.add("application/xml"); supportedMimeTypes.add("application/xml");
supportedMimeTypes.add("text/xml");
supportedMimeTypes.add("text/plain"); supportedMimeTypes.add("text/plain");
supportedMimeTypes.add("text/csv"); supportedMimeTypes.add("text/csv");
supportedMimeTypes.add("application/avro-binary"); supportedMimeTypes.add("application/avro-binary");
@ -85,7 +86,7 @@ public class StandardContentViewerController extends HttpServlet {
final ObjectMapper mapper = new ObjectMapper(); final ObjectMapper mapper = new ObjectMapper();
final Object objectJson = mapper.readValue(content.getContentStream(), Object.class); final Object objectJson = mapper.readValue(content.getContentStream(), Object.class);
formatted = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(objectJson); formatted = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(objectJson);
} else if ("application/xml".equals(contentType)) { } else if ("application/xml".equals(contentType) || "text/xml".equals(contentType)) {
// format xml // format xml
final StringWriter writer = new StringWriter(); final StringWriter writer = new StringWriter();

View File

@ -14,6 +14,7 @@
# limitations under the License. # limitations under the License.
application/xml application/xml
application/json application/json
text/xml
text/plain text/plain
text/csv text/csv
avro/binary avro/binary