use of com.microsoft.azuretools.authmanage.interact.INotification in project azure-tools-for-java by Microsoft.
the class AuthMethodManager method getAzureManager.
private AzureManager getAzureManager(AuthMethod authMethod) throws IOException {
if (azureManager != null)
return azureManager;
switch(authMethod) {
case AD:
if (StringUtils.isNullOrEmpty(authMethodDetails.getAccountEmail())) {
return null;
}
azureManager = new AccessTokenAzureManager();
break;
case SP:
String credFilePath = authMethodDetails.getCredFilePath();
if (StringUtils.isNullOrEmpty(credFilePath)) {
return null;
}
Path filePath = Paths.get(credFilePath);
if (!Files.exists(filePath)) {
cleanAll();
INotification nw = CommonSettings.getUiFactory().getNotificationWindow();
nw.deliver("Credential File Error", "File doesn't exist: " + filePath.toString());
return null;
}
azureManager = new ServicePrincipalAzureManager(new File(credFilePath));
}
return azureManager;
}
Aggregations