use of org.talend.components.azurestorage.blob.tazurestorageput.TAzureStoragePutProperties in project components by Talend.
the class AzureStorageBaseBlobTestIT method uploadTestBlobs.
/**
* uploadTestBlobs.
*
* @param container {@link String} container
* @throws Exception the exception
*/
public void uploadTestBlobs(String container) throws Exception {
assertTrue(doContainerCreate(container, AccessControl.Private));
TAzureStoragePutProperties props = new TAzureStoragePutProperties("tests");
props.container.setValue(container);
setupConnectionProperties(props);
props.localFolder.setValue(FOLDER_PATH_PUT);
props.remoteFolder.setValue("");
assertTrue(createBoundedReader(props).start());
}
use of org.talend.components.azurestorage.blob.tazurestorageput.TAzureStoragePutProperties in project components by Talend.
the class AzureStoragePutRuntimeTest method setup.
@Before
public void setup() throws IOException {
properties = new TAzureStoragePutProperties(PROP_ + "Put");
properties.setupProperties();
// valid connection
properties.connection = new TAzureStorageConnectionProperties(PROP_ + "Connection");
properties.connection.protocol.setValue(Protocol.HTTP);
properties.connection.accountName.setValue("fakeAccountName");
properties.connection.accountKey.setValue("fakeAccountKey=ANBHFYRJJFHRIKKJFU");
properties.container.setValue("goog-container-name-1");
runtimeContainer = new RuntimeContainerMock();
this.storagePut = new AzureStoragePutRuntime();
localFolderPath = getClass().getClassLoader().getResource("azurestorage-put").getPath();
}
use of org.talend.components.azurestorage.blob.tazurestorageput.TAzureStoragePutProperties 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);
}
}
Aggregations