Search in sources :

Example 1 with IS3DatasetRuntime

use of org.talend.components.simplefileio.s3.runtime.IS3DatasetRuntime in project components by Talend.

the class S3DatasetProperties method afterRegion.

public void afterRegion() {
    refreshLayout(getForm(Form.MAIN));
    S3DatasetDefinition definition = new S3DatasetDefinition();
    RuntimeInfo runtimeInfo = definition.getRuntimeInfo(this);
    try (SandboxedInstance sandboxedInstance = RuntimeUtil.createRuntimeClass(runtimeInfo, getClass().getClassLoader())) {
        IS3DatasetRuntime runtime = (IS3DatasetRuntime) sandboxedInstance.getInstance();
        runtime.initialize(null, this);
        this.bucket.setPossibleValues(new ArrayList<String>(runtime.listBuckets()));
    } catch (Exception e) {
        TalendRuntimeException.build(ComponentsErrorCode.IO_EXCEPTION, e).throwIt();
    }
}
Also used : SandboxedInstance(org.talend.daikon.sandbox.SandboxedInstance) RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) IS3DatasetRuntime(org.talend.components.simplefileio.s3.runtime.IS3DatasetRuntime) TalendRuntimeException(org.talend.daikon.exception.TalendRuntimeException)

Aggregations

IS3DatasetRuntime (org.talend.components.simplefileio.s3.runtime.IS3DatasetRuntime)1 TalendRuntimeException (org.talend.daikon.exception.TalendRuntimeException)1 RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)1 SandboxedInstance (org.talend.daikon.sandbox.SandboxedInstance)1