use of org.talend.components.azurestorage.blob.AzureStorageBlobService in project components by Talend.
the class AzureStoragePutRuntime method initialize.
@Override
public ValidationResult initialize(RuntimeContainer runtimeContainer, ComponentProperties properties) {
ValidationResult validationResult = super.initialize(runtimeContainer, properties);
if (validationResult.getStatus() == ValidationResult.Result.ERROR) {
return validationResult;
}
TAzureStoragePutProperties componentProperties = (TAzureStoragePutProperties) properties;
localFolder = componentProperties.localFolder.getValue();
remoteFolder = componentProperties.remoteFolder.getValue();
useFileList = componentProperties.useFileList.getValue();
files = componentProperties.files;
this.dieOnError = componentProperties.dieOnError.getValue();
this.azureStorageBlobService = new AzureStorageBlobService(getAzureConnection(runtimeContainer));
// checks local folder
String errorMessage = "";
if (!new File(localFolder).exists()) {
// $NON-NLS-1$
errorMessage = messages.getMessage("error.EmptyLocalFolder");
} else // checks file list if set.
if (useFileList && files.fileMask.getValue().isEmpty()) {
// $NON-NLS-1$
errorMessage = messages.getMessage("error.EmptyFileList");
}
if (errorMessage.isEmpty()) {
// everything is OK.
return ValidationResult.OK;
} else {
return new ValidationResult(ValidationResult.Result.ERROR, errorMessage);
}
}
use of org.talend.components.azurestorage.blob.AzureStorageBlobService in project components by Talend.
the class AzureStorageContainerDeleteRuntime method initialize.
@Override
public ValidationResult initialize(RuntimeContainer runtimeContainer, ComponentProperties properties) {
ValidationResult validationResult = super.initialize(runtimeContainer, properties);
if (validationResult.getStatus() == ValidationResult.Result.ERROR) {
return validationResult;
}
TAzureStorageContainerDeleteProperties componentProperties = (TAzureStorageContainerDeleteProperties) properties;
this.dieOnError = componentProperties.dieOnError.getValue();
this.blobService = new AzureStorageBlobService(getAzureConnection(runtimeContainer));
return ValidationResult.OK;
}
use of org.talend.components.azurestorage.blob.AzureStorageBlobService in project components by Talend.
the class AzureStorageContainerExistRuntime method initialize.
@Override
public ValidationResult initialize(RuntimeContainer runtimeContainer, ComponentProperties properties) {
ValidationResult validationResult = super.initialize(runtimeContainer, properties);
if (validationResult.getStatus() == ValidationResult.Result.ERROR) {
return validationResult;
}
TAzureStorageContainerExistProperties componentProperties = (TAzureStorageContainerExistProperties) properties;
this.dieOnError = componentProperties.dieOnError.getValue();
this.azureStorageBlobService = new AzureStorageBlobService(getAzureConnection(runtimeContainer));
return ValidationResult.OK;
}
use of org.talend.components.azurestorage.blob.AzureStorageBlobService in project components by Talend.
the class AzureStorageGetRuntime method initialize.
@Override
public ValidationResult initialize(RuntimeContainer runtimeContainer, ComponentProperties properties) {
ValidationResult validationResult = super.initialize(runtimeContainer, properties);
if (validationResult.getStatus() == ValidationResult.Result.ERROR) {
return validationResult;
}
TAzureStorageGetProperties componentProperties = (TAzureStorageGetProperties) properties;
localFolder = componentProperties.localFolder.getValue();
remoteBlobsGet = componentProperties.remoteBlobsGet;
this.dieOnError = componentProperties.dieOnError.getValue();
azureStorageBlobService = new AzureStorageBlobService(getAzureConnection(runtimeContainer));
String errorMessage = "";
if (remoteBlobsGet.prefix.getValue() == null || remoteBlobsGet.prefix.getValue().isEmpty()) {
// $NON-NLS-1$
errorMessage = messages.getMessage("error.EmptyBlobs");
}
if (errorMessage.isEmpty()) {
// everything is OK.
return ValidationResult.OK;
} else {
return new ValidationResult(ValidationResult.Result.ERROR, errorMessage);
}
}
use of org.talend.components.azurestorage.blob.AzureStorageBlobService in project components by Talend.
the class AzureStorageContainerCreateRuntime method initialize.
@Override
public ValidationResult initialize(RuntimeContainer runtimeContainer, ComponentProperties properties) {
ValidationResult validationResult = super.initialize(runtimeContainer, properties);
if (validationResult.getStatus() == ValidationResult.Result.ERROR) {
return validationResult;
}
TAzureStorageContainerCreateProperties componentProperties = (TAzureStorageContainerCreateProperties) properties;
this.access = componentProperties.accessControl.getValue();
this.dieOnError = componentProperties.dieOnError.getValue();
this.blobService = new AzureStorageBlobService(getAzureConnection(runtimeContainer));
return ValidationResult.OK;
}
Aggregations