Repository: nifi
Updated Branches:
  refs/heads/master 854c667bd -> 8070a9f1c


NIFI-1104:
- Using the appropriate attributes based on the content direction.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/8070a9f1
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/8070a9f1
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/8070a9f1

Branch: refs/heads/master
Commit: 8070a9f1ccbb620429812dc80e74494d2df10c99
Parents: 854c667
Author: Matt Gilman <[email protected]>
Authored: Fri Dec 11 10:59:41 2015 -0500
Committer: Matt Gilman <[email protected]>
Committed: Fri Dec 11 10:59:41 2015 -0500

----------------------------------------------------------------------
 .../apache/nifi/web/controller/ControllerFacade.java   | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/8070a9f1/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java
index 47ebd30..dbf24e1 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java
@@ -820,7 +820,12 @@ public class ControllerFacade {
             }
 
             // get the flowfile attributes
-            final Map<String, String> attributes = event.getAttributes();
+            final Map<String, String> attributes;
+            if (ContentDirection.INPUT.equals(contentDirection)) {
+                attributes = event.getPreviousAttributes();
+            } else {
+                attributes = event.getAttributes();
+            }
 
             // calculate the dn chain
             final List<String> dnChain = 
ProxiedEntitiesUtils.buildProxiedEntitiesChain(user);
@@ -831,14 +836,14 @@ public class ControllerFacade {
                 throw new 
AccessDeniedException(downloadAuthorization.getExplanation());
             }
 
-            // get the filename and fall back to the idnetifier (should never 
happen)
-            String filename = 
event.getAttributes().get(CoreAttributes.FILENAME.key());
+            // get the filename and fall back to the identifier (should never 
happen)
+            String filename = attributes.get(CoreAttributes.FILENAME.key());
             if (filename == null) {
                 filename = event.getFlowFileUuid();
             }
 
             // get the mime-type
-            final String type = 
event.getAttributes().get(CoreAttributes.MIME_TYPE.key());
+            final String type = attributes.get(CoreAttributes.MIME_TYPE.key());
 
             // get the content
             final InputStream content = flowController.getContent(event, 
contentDirection, user.getIdentity(), uri);

Reply via email to