NIFI-4770 - ListAzureBlobStorage now properly writes azure.container flowfile attribute

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #2402.
This commit is contained in:
zenfenaan 2018-01-12 22:45:13 +05:30 committed by Pierre Villard
parent ca54186b60
commit 94eb11bfa6
2 changed files with 14 additions and 0 deletions

View File

@ -102,6 +102,7 @@ public class ListAzureBlobStorage extends AbstractListProcessor<BlobInfo> {
@Override
protected Map<String, String> createAttributes(BlobInfo entity, ProcessContext context) {
final Map<String, String> attributes = new HashMap<>();
attributes.put("azure.container", entity.getContainerName());
attributes.put("azure.etag", entity.getEtag());
attributes.put("azure.primaryUri", entity.getPrimaryUri());
attributes.put("azure.secondaryUri", entity.getSecondaryUri());
@ -162,6 +163,7 @@ public class ListAzureBlobStorage extends AbstractListProcessor<BlobInfo> {
Builder builder = new BlobInfo.Builder()
.primaryUri(uri.getPrimaryUri().toString())
.containerName(containerName)
.contentType(properties.getContentType())
.contentLanguage(properties.getContentLanguage())
.etag(properties.getEtag())

View File

@ -31,6 +31,7 @@ public class BlobInfo implements Comparable<BlobInfo>, Serializable, ListableEnt
private final long lastModifiedTime;
private final long length;
private final String blobType;
private final String containerName;
public static long getSerialversionuid() {
return serialVersionUID;
@ -52,6 +53,10 @@ public class BlobInfo implements Comparable<BlobInfo>, Serializable, ListableEnt
return contentLanguage;
}
public String getContainerName() {
return containerName;
}
public String getEtag() {
return etag;
}
@ -77,6 +82,7 @@ public class BlobInfo implements Comparable<BlobInfo>, Serializable, ListableEnt
private long lastModifiedTime;
private long length;
private String blobType;
private String containerName;
public Builder primaryUri(String primaryUri) {
this.primaryUri = primaryUri;
@ -98,6 +104,11 @@ public class BlobInfo implements Comparable<BlobInfo>, Serializable, ListableEnt
return this;
}
public Builder containerName(String containerName) {
this.containerName = containerName;
return this;
}
public Builder etag(String etag) {
this.etag = etag;
return this;
@ -164,6 +175,7 @@ public class BlobInfo implements Comparable<BlobInfo>, Serializable, ListableEnt
this.secondaryUri = builder.secondaryUri;
this.contentType = builder.contentType;
this.contentLanguage = builder.contentLanguage;
this.containerName = builder.containerName;
this.etag = builder.etag;
this.lastModifiedTime = builder.lastModifiedTime;
this.length = builder.length;