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

    https://github.com/apache/nifi/pull/2400#discussion_r161126450
  
    --- Diff: 
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/utils/AzureStorageUtils.java
 ---
    @@ -78,10 +84,15 @@ private AzureStorageUtils() {
             // do not instantiate
         }
     
    -    public static CloudBlobClient createCloudBlobClient(ProcessContext 
context, ComponentLog logger) {
    -        final String accountName = 
context.getProperty(AzureStorageUtils.ACCOUNT_NAME).evaluateAttributeExpressions().getValue();
    -        final String accountKey = 
context.getProperty(AzureStorageUtils.ACCOUNT_KEY).evaluateAttributeExpressions().getValue();
    -        final String sasToken = 
context.getProperty(AzureStorageUtils.PROP_SAS_TOKEN).evaluateAttributeExpressions().getValue();
    +    /**
    +     * Create CloudBlobClient instance.
    +     * @param flowFile An incoming FlowFile can be used for NiFi 
Expression Language evaluation to derive
    +     *                 Account Name, Account Key or SAS Token. This can be 
null if not available.
    +     */
    +    public static CloudBlobClient createCloudBlobClient(ProcessContext 
context, ComponentLog logger, FlowFile flowFile) {
    +        final String accountName = 
context.getProperty(AzureStorageUtils.ACCOUNT_NAME).evaluateAttributeExpressions(flowFile).getValue();
    +        final String accountKey = 
context.getProperty(AzureStorageUtils.ACCOUNT_KEY).evaluateAttributeExpressions(flowFile).getValue();
    +        final String sasToken = 
context.getProperty(AzureStorageUtils.PROP_SAS_TOKEN).evaluateAttributeExpressions(flowFile).getValue();
    --- End diff --
    
    this is probably just a stylistic thing but I'd prefer we didn't pass a 
null in here if a given flowfile is null.  Rather it seems cleaner to me that 
we'd check if the supplied flowfile is null and if so called 
evaluatedAttrExpres without the flowfile reference.
    



---

Reply via email to