mirror of https://github.com/apache/nifi.git
NIFI-1835 - added text/xml to content viewer
Signed-off-by: Scott Aslan <scottyaslan@gmail.com> This closes #2098
This commit is contained in:
parent
0bcb19771f
commit
41984bed13
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue