use of org.opendaylight.mdsal.yanglib.api.SourceReference in project mdsal by opendaylight.
the class MountPointContextFactoryImpl method fillSource.
private static void fillSource(final List<SourceReference> sources, final YangIdentifier sourceName, final Optional<Revision> revision, final Set<Uri> uris) {
final var sourceId = RevisionSourceIdentifier.create(sourceName.getValue(), revision);
final SourceReference sourceRef;
if (uris != null && uris.isEmpty()) {
final var locations = new ArrayList<URL>();
for (Uri uri : uris) {
try {
locations.add(new URL(uri.getValue()));
} catch (MalformedURLException e) {
LOG.debug("Ignoring invalid schema location {}", uri, e);
}
}
sourceRef = SourceReference.of(sourceId, locations);
} else {
sourceRef = SourceReference.of(sourceId);
}
sources.add(sourceRef);
}
Aggregations