use of org.apache.dubbo.metadata.rest.RestMetadataConstants.SERVICE_REST_METADATA_RESOURCE_PATH in project dubbo by alibaba.
the class ServiceRestMetadataStorage method append.
public void append(Set<ServiceRestMetadata> serviceRestMetadata) throws IOException {
storage.read(SERVICE_REST_METADATA_RESOURCE_PATH, reader -> {
Gson gson = new Gson();
return (List) gson.fromJson(reader, getParameterized(List.class, ServiceRestMetadata.class).getType());
}).ifPresent(existedMetadata -> {
// Add all existed ServiceRestMetadata
serviceRestMetadata.addAll(existedMetadata);
});
write(serviceRestMetadata);
}
Aggregations