Search in sources :

Example 1 with AzureStorageBlobProperties

use of org.talend.components.azurestorage.blob.AzureStorageBlobProperties in project components by Talend.

the class AzureStorageSource method getRemoteBlobs.

public List<RemoteBlob> getRemoteBlobs() {
    List<RemoteBlob> remoteBlobs = new ArrayList<RemoteBlob>();
    if (!(this.properties instanceof AzureStorageBlobProperties))
        return null;
    AzureStorageBlobProperties p = (AzureStorageBlobProperties) properties;
    ValidationResult vr = p.remoteBlobs.getValidationResult();
    if (vr.getStatus().equals(Result.ERROR)) {
        throw new IllegalArgumentException(vr.getMessage());
    }
    for (int idx = 0; idx < p.remoteBlobs.prefix.getValue().size(); idx++) {
        String prefix = (p.remoteBlobs.prefix.getValue().get(idx) != null) ? p.remoteBlobs.prefix.getValue().get(idx) : "";
        Boolean include = (p.remoteBlobs.include.getValue().get(idx) != null) ? p.remoteBlobs.include.getValue().get(idx) : false;
        remoteBlobs.add(new RemoteBlob(prefix, include));
    }
    return remoteBlobs;
}
Also used : AzureStorageBlobProperties(org.talend.components.azurestorage.blob.AzureStorageBlobProperties) ArrayList(java.util.ArrayList) RemoteBlob(org.talend.components.azurestorage.blob.helpers.RemoteBlob) ValidationResult(org.talend.daikon.properties.ValidationResult)

Example 2 with AzureStorageBlobProperties

use of org.talend.components.azurestorage.blob.AzureStorageBlobProperties in project components by Talend.

the class AzureStorageSourceTest method setUp.

@Before
public void setUp() throws Exception {
    source = new AzureStorageSource();
    AzureStorageBlobProperties props = new TAzureStorageListProperties("test");
}
Also used : TAzureStorageListProperties(org.talend.components.azurestorage.blob.tazurestoragelist.TAzureStorageListProperties) AzureStorageBlobProperties(org.talend.components.azurestorage.blob.AzureStorageBlobProperties) Before(org.junit.Before)

Aggregations

AzureStorageBlobProperties (org.talend.components.azurestorage.blob.AzureStorageBlobProperties)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 RemoteBlob (org.talend.components.azurestorage.blob.helpers.RemoteBlob)1 TAzureStorageListProperties (org.talend.components.azurestorage.blob.tazurestoragelist.TAzureStorageListProperties)1 ValidationResult (org.talend.daikon.properties.ValidationResult)1