use of com.microsoft.azure.functions.annotation.StorageAccount in project azure-tools-for-java by Microsoft.
the class FunctionUtils method patchStorageBinding.
private static void patchStorageBinding(final PsiMethod method, final List<Binding> bindings) {
final PsiAnnotation storageAccount = AnnotationUtil.findAnnotation(method, StorageAccount.class.getCanonicalName());
if (storageAccount != null) {
// todo: Remove System.out.println
System.out.println(message("function.binding.storage.found"));
final String connectionString = AnnotationUtil.getDeclaredStringAttributeValue(storageAccount, "value");
// Replace empty connection string
bindings.stream().filter(binding -> binding.getBindingEnum().isStorage()).filter(binding -> StringUtils.isEmpty((String) binding.getAttribute("connection"))).forEach(binding -> binding.setAttribute("connection", connectionString));
} else {
// todo: Remove System.out.println
System.out.println(message("function.binding.storage.notFound"));
}
}
Aggregations