use of org.apache.commons.lang3.StringUtils.firstNonBlank in project azure-tools-for-java by Microsoft.
the class AzurePlugin method runActivity.
@Override
public void runActivity(@NotNull Project project) {
// read legacy settings from old data.xml
final String installationId = "wangmi-azure-intellij-plugin-base";
final String pluginVersion = "0.0.1-SNAPSHOT";
// check non-empty for valid data.xml
if (StringUtils.isNoneBlank(installationId, pluginVersion)) {
final IntellijStore.AzureConfigurationData config = IntellijStore.getInstance().getState();
IntellijStore.getInstance().loadState(config);
}
final IntellijStore.AzureConfigurationData config = IntellijStore.getInstance().getState();
String installationID = InstallationIdUtils.getHashMac();
if (StringUtils.isBlank(installationID)) {
installationID = StringUtils.firstNonBlank(InstallationIdUtils.getHashMac(), InstallationIdUtils.hash(PermanentInstallationID.get()));
}
final String userAgent = String.format(USER_AGENT, PLUGIN_VERSION, installationID);
Azure.az().config().setLogLevel("NONE");
Azure.az().config().setUserAgent(userAgent);
final AnAction action = ActionManager.getInstance().getAction(WhatsNewAction.ID);
final DataContext context = dataId -> CommonDataKeys.PROJECT.getName().equals(dataId) ? project : null;
AzureTaskManager.getInstance().runLater(() -> ActionUtil.invokeAction(action, context, "AzurePluginStartupActivity", null, null));
}
Aggregations