mirror of
https://github.com/apache/nifi.git
synced 2025-02-17 15:36:36 +00:00
NIFI-1104:
- Using the appropriate attributes based on the content direction.
This commit is contained in:
parent
854c667bd3
commit
8070a9f1cc
@ -820,7 +820,12 @@ public class ControllerFacade {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get the flowfile attributes
|
// 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
|
// calculate the dn chain
|
||||||
final List<String> dnChain = ProxiedEntitiesUtils.buildProxiedEntitiesChain(user);
|
final List<String> dnChain = ProxiedEntitiesUtils.buildProxiedEntitiesChain(user);
|
||||||
@ -831,14 +836,14 @@ public class ControllerFacade {
|
|||||||
throw new AccessDeniedException(downloadAuthorization.getExplanation());
|
throw new AccessDeniedException(downloadAuthorization.getExplanation());
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the filename and fall back to the idnetifier (should never happen)
|
// get the filename and fall back to the identifier (should never happen)
|
||||||
String filename = event.getAttributes().get(CoreAttributes.FILENAME.key());
|
String filename = attributes.get(CoreAttributes.FILENAME.key());
|
||||||
if (filename == null) {
|
if (filename == null) {
|
||||||
filename = event.getFlowFileUuid();
|
filename = event.getFlowFileUuid();
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the mime-type
|
// 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
|
// get the content
|
||||||
final InputStream content = flowController.getContent(event, contentDirection, user.getIdentity(), uri);
|
final InputStream content = flowController.getContent(event, contentDirection, user.getIdentity(), uri);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user