ServiceDescriptorsRepresentation serviceDescriptorsRepresentation;
if (serviceInventoryUri.getScheme().toLowerCase().startsWith("http")) {
Builder requestBuilder = prepareGet()
.setUri(serviceInventoryUri)
.setHeader("User-Agent", nodeInfo.getNodeId());
serviceDescriptorsRepresentation = httpClient.execute(requestBuilder.build(), createJsonResponseHandler(serviceDescriptorsCodec));
}
else {
File file = new File(serviceInventoryUri);
serviceDescriptorsRepresentation = serviceDescriptorsCodec.fromJson(readAllBytes(file.toPath()));
}