Search in sources :

Example 6 with AuthMethodDetails

use of com.microsoft.azuretools.authmanage.models.AuthMethodDetails in project azure-tools-for-java by Microsoft.

the class AuthMethodManager method loadSettings.

private void loadSettings() throws IOException {
    System.out.println("loading authMethodDetails...");
    FileStorage fs = new FileStorage(CommonSettings.authMethodDetailsFileName, CommonSettings.settingsBaseDir);
    byte[] data = fs.read();
    String json = new String(data);
    if (json.isEmpty()) {
        System.out.println(CommonSettings.authMethodDetailsFileName + "file is empty");
        authMethodDetails = new AuthMethodDetails();
        return;
    }
    authMethodDetails = JsonHelper.deserialize(AuthMethodDetails.class, json);
}
Also used : AuthMethodDetails(com.microsoft.azuretools.authmanage.models.AuthMethodDetails)

Aggregations

AuthMethodDetails (com.microsoft.azuretools.authmanage.models.AuthMethodDetails)6 AuthMethodManager (com.microsoft.azuretools.authmanage.AuthMethodManager)2 SubscriptionManager (com.microsoft.azuretools.authmanage.SubscriptionManager)1 IUIFactory (com.microsoft.azuretools.authmanage.interact.IUIFactory)1 SubscriptionDetail (com.microsoft.azuretools.authmanage.models.SubscriptionDetail)1 SignInDialog (com.microsoft.azuretools.core.ui.SignInDialog)1 SignInWindow (com.microsoft.azuretools.ijidea.ui.SignInWindow)1 AccessTokenAzureManager (com.microsoft.azuretools.sdkmanage.AccessTokenAzureManager)1 AzureManager (com.microsoft.azuretools.sdkmanage.AzureManager)1 File (java.io.File)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 ExecutionException (org.eclipse.core.commands.ExecutionException)1