use of com.microsoft.azuretools.azurecommons.helpers.NotNull in project azure-tools-for-java by Microsoft.
the class IDEHelperImpl method runInBackground.
@NotNull
@Override
public CancellableTask.CancellableTaskHandle runInBackground(@NotNull ProjectDescriptor projectDescriptor, @NotNull final String name, @Nullable final String indicatorText, @NotNull final CancellableTask cancellableTask) throws AzureCmdException {
final CancellableTaskHandleImpl handle = new CancellableTaskHandleImpl();
final Project project = findOpenProject(projectDescriptor);
// background tasks via ProgressManager can be scheduled only on the
// dispatch thread
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ProgressManager.getInstance().run(getCancellableBackgroundTask(project, name, indicatorText, handle, cancellableTask));
}
}, ModalityState.any());
return handle;
}
use of com.microsoft.azuretools.azurecommons.helpers.NotNull in project azure-tools-for-java by Microsoft.
the class StorageClientSDKManager method getBlobContainers.
@NotNull
public List<BlobContainer> getBlobContainers(@NotNull String connectionString) throws AzureCmdException {
List<BlobContainer> bcList = new ArrayList<BlobContainer>();
try {
CloudBlobClient client = getCloudBlobClient(connectionString);
for (CloudBlobContainer container : client.listContainers(null, ContainerListingDetails.ALL, null, null)) {
String uri = container.getUri() != null ? container.getUri().toString() : "";
String eTag = "";
Calendar lastModified = new GregorianCalendar();
BlobContainerProperties properties = container.getProperties();
if (properties != null) {
eTag = Strings.nullToEmpty(properties.getEtag());
if (properties.getLastModified() != null) {
lastModified.setTime(properties.getLastModified());
}
}
String publicReadAccessType = "";
BlobContainerPermissions blobContainerPermissions = container.downloadPermissions();
if (blobContainerPermissions != null && blobContainerPermissions.getPublicAccess() != null) {
publicReadAccessType = blobContainerPermissions.getPublicAccess().toString();
}
bcList.add(new BlobContainer(Strings.nullToEmpty(container.getName()), uri, eTag, lastModified, publicReadAccessType));
}
return bcList;
} catch (Throwable t) {
throw new AzureCmdException("Error retrieving the Blob Container list", t);
}
}
use of com.microsoft.azuretools.azurecommons.helpers.NotNull in project azure-tools-for-java by Microsoft.
the class HDInsightHelperImpl method createAddNewHDInsightReaderClusterAction.
@NotNull
public NodeActionListener createAddNewHDInsightReaderClusterAction(@NotNull HDInsightRootModule module, @NotNull ClusterDetail clusterDetail) {
return new NodeActionListener() {
@Override
protected void actionPerformed(NodeActionEvent nodeActionEvent) throws AzureCmdException {
AddNewHDInsightReaderClusterForm linkClusterForm = new AddNewHDInsightReaderClusterForm(PluginUtil.getParentShell(), module, clusterDetail);
linkClusterForm.open();
}
};
}
use of com.microsoft.azuretools.azurecommons.helpers.NotNull in project azure-tools-for-java by Microsoft.
the class TelemetryUtils method getMachieId.
@NotNull
public static String getMachieId(String dataFile, String prefVal, String instId) {
String ret = "";
if (new File(dataFile).exists()) {
String prefValue = DataOperations.getProperty(dataFile, prefVal);
if (prefValue != null && prefValue.equalsIgnoreCase("false")) {
return ret;
}
ret = DataOperations.getProperty(dataFile, instId);
if (ret == null || ret.isEmpty() || !InstallationIdUtils.isValidHashMac(ret)) {
ret = InstallationIdUtils.getHashMac();
}
} else {
ret = InstallationIdUtils.getHashMac();
}
return ret;
}
use of com.microsoft.azuretools.azurecommons.helpers.NotNull in project azure-tools-for-java by Microsoft.
the class CreateProjectUtil method convert.
@NotNull
private static IFile convert(@NotNull File file) {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IPath location = Path.fromOSString(file.getAbsolutePath());
IFile ifile = workspace.getRoot().getFileForLocation(location);
return ifile;
}
Aggregations