Github user mcgilman commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/617#discussion_r71035162
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/TemplateResource.java
 ---
    @@ -168,7 +172,13 @@ public Response exportTemplate(
             }
     
             // generate the response
    -        return generateOkResponse(template).header("Content-Disposition", 
String.format("attachment; filename=\"%s.xml\"", attachmentName)).build();
    +        /*
    +         * Here instead of relying on default JAXB marshalling we are 
simply
    +         * serializing template to String (formatted, indented etc) and 
sending
    +         * it as part of the response.
    +         */
    +        String serializedTemplate = new 
String(TemplateSerializer.serialize(template), StandardCharsets.UTF_8);
    --- End diff --
    
    This is fine here but we could have stream the template instead of 
converting to a String in memory using an approach like [1]
    
    [1] 
https://github.com/apache/nifi/blob/5cd5a4ce788bec39e0dc5c7db93356610a9fa84e/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProvenanceEventResource.java#L146


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to