markap14 commented on code in PR #5944:
URL: https://github.com/apache/nifi/pull/5944#discussion_r876048112
##########
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/ListAzureBlobStorage.java:
##########
@@ -140,6 +144,15 @@ protected Map<String, String> createAttributes(BlobInfo
entity, ProcessContext c
attributes.put("mime.type", entity.getContentType());
attributes.put("lang", entity.getContentLanguage());
+ final String entityName = entity.getBlobName();
+ if (entityName.contains("/")) {
+ attributes.put(CoreAttributes.FILENAME.key(),
StringUtils.substringAfterLast(entityName, "/"));
+ attributes.put(CoreAttributes.PATH.key(),
StringUtils.substringBeforeLast(entityName, "/"));
+ } else {
+ attributes.put(CoreAttributes.FILENAME.key(), entityName);
+ attributes.put(CoreAttributes.PATH.key(), ".");
Review Comment:
I don't believe so. I think `.` makes the most sense. I can definitely see
the argument for why you'd say that `/` makes the most sense. However, consider
that we then want to maintain the same directory structure when pushing the
data elsewhere. Let's say we have ListAzureBlobStorage -> FetchAzureBlobStorage
-> PutFile for instance. We don't want PutFile trying to write the data to the
root of the file system. We want it writing to whatever directory it's
configured to write to. So a value of `.` is essentially "the root of where
you're configured to write to" vs. "the root of the file system."
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]