use of com.microsoft.azuretools.telemetry.TelemetryConstants.CREATE_BLOB_CONTAINER in project azure-tools-for-java by Microsoft.
the class CreateBlobContainerForm method doOKAction.
@Override
protected void doOKAction() {
final String name = nameTextField.getText();
// Field outerFiele = onCreate.getClass().getDeclaredField("this$0");
final AzureString title = AzureOperationBundle.title("blob.create", name);
AzureTaskManager.getInstance().runInBackground(new AzureTask(project, title, false, () -> {
EventUtil.executeWithLog(STORAGE, CREATE_BLOB_CONTAINER, (operation) -> {
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
List<BlobContainer> blobs = StorageClientSDKManager.getManager().getBlobContainers(connectionString);
for (BlobContainer blobContainer : blobs) {
if (blobContainer.getName().equals(name)) {
AzureTaskManager.getInstance().runLater(() -> {
DefaultLoader.getUIHelper().showError("A blob container with the specified name already exists.", "Azure Explorer");
});
return;
}
}
BlobContainer blobContainer = new BlobContainer(name, "", /*storageAccount.getBlobsUri() + name*/
"", Calendar.getInstance(), "");
StorageClientSDKManager.getManager().createBlobContainer(connectionString, blobContainer);
if (onCreate != null) {
AzureTaskManager.getInstance().runLater(onCreate);
}
}, (e) -> {
String msg = "An error occurred while attempting to create blob container." + "\n" + String.format(message("webappExpMsg"), e.getMessage());
PluginUtil.displayErrorDialogAndLog(message("errTtl"), msg, e);
});
}));
sendTelemetry(OK_EXIT_CODE);
this.close(DialogWrapper.OK_EXIT_CODE, true);
}
Aggregations