if (identifier == null || !identifier.contains(RestconfConstants.MOUNT)) {
return createIIdContext(schemaContext, identifier, null);
}
- if (!mountPointService.isPresent()) {
+ if (mountPointService.isEmpty()) {
throw new RestconfDocumentedException("Mount point service is not available");
}
final YangInstanceIdentifier mountPath = IdentifierCodec.deserialize(mountPointId, schemaContext);
final DOMMountPoint mountPoint = mountPointService.get().getMountPoint(mountPath)
.orElseThrow(() -> new RestconfDocumentedException("Mount point does not exist.",
- ErrorType.PROTOCOL, ErrorTag.DATA_MISSING));
+ ErrorType.PROTOCOL, ErrorTag.RESOURCE_DENIED_TRANSPORT));
final EffectiveModelContext mountSchemaContext = coerceModelContext(mountPoint);
final String pathId = pathsIt.next().replaceFirst("/", "");
final String current = componentIter.next();
if (RestconfConstants.MOUNT.equals(current)) {
- pathBuilder.append("/");
- pathBuilder.append(RestconfConstants.MOUNT);
+ pathBuilder.append('/').append(RestconfConstants.MOUNT);
break;
}
if (pathBuilder.length() != 0) {
- pathBuilder.append("/");
+ pathBuilder.append('/');
}
pathBuilder.append(current);