Skip to content
Permalink
Browse files
Adding metadata type when publishing
  • Loading branch information
DImuthuUpe committed Sep 9, 2021
1 parent d5f7c53 commit 15cdd0a12a67fa5c3ee92f0dc3ea2555b0ad9a9b
Showing 2 changed files with 5 additions and 4 deletions.
@@ -181,6 +181,7 @@ public void addResourceMetadata(String authToken,
String tenantId,
String resourceId,
String user,
String type,
Map<String, String> metadata) {

DRMSServiceAuthToken serviceAuthToken = DRMSServiceAuthToken.newBuilder()
@@ -199,7 +200,7 @@ public void addResourceMetadata(String authToken,
resourceServiceBlockingStub.addResourceMetadata(AddResourceMetadataRequest.newBuilder()
.setResourceId(resourceId)
.setAuthToken(serviceAuthToken)
.setType("FILE")
.setType(type)
.setMetadata(structBuilder.build()).build());
}

@@ -84,14 +84,14 @@ private List<GenericResource> createResourceRecursively(String hostName, String
resourceId, resourceName, currentPath, parentId, "COLLECTION", parentType, user);
if (optionalGenericResource.isPresent()) {
parentId = optionalGenericResource.get().getResourceId();
parentType = "COLLECTION";

Map<String, String> metadata = new HashMap<>();
metadata.put("resourcePath", currentPath);
metadata.put("hostName", hostName);
this.drmsConnector.addResourceMetadata(notification.getAuthToken(),
notification.getTenantId(), parentId, user, metadata);
notification.getTenantId(), parentId, user, parentType, metadata);

parentType = "COLLECTION";
resourceList.add(optionalGenericResource.get());
} else {
logger.error("Could not create a resource for path {}", currentPath);
@@ -115,7 +115,7 @@ private List<GenericResource> createResourceRecursively(String hostName, String
metadata.put("resourcePath", currentPath);
metadata.put("hostName", hostName);
this.drmsConnector.addResourceMetadata(notification.getAuthToken(),
notification.getTenantId(), genericResource.getResourceId(), user, metadata);
notification.getTenantId(), genericResource.getResourceId(), user, resourceType, metadata);

resourceList.add(genericResource);
} else {

0 comments on commit 15cdd0a

Please sign in to comment.