use of org.talend.components.google.drive.GoogleDriveProvideRuntime in project components by Talend.
the class GoogleDriveConnectionProperties method validateTestConnection.
public ValidationResult validateTestConnection() throws Exception {
try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, true)) {
GoogleDriveProvideRuntime sos = (GoogleDriveProvideRuntime) sandboxedInstance.getInstance();
sos.initialize(null, this);
try {
ValidationResultMutable vr = new ValidationResultMutable(sos.validateConnection(this));
if (Result.OK.equals(vr.getStatus())) {
getForm(FORM_WIZARD).setAllowFinish(true);
} else {
getForm(FORM_WIZARD).setAllowFinish(false);
}
return vr;
} catch (Exception e) {
LOG.error("[validateTestConnection] {}.", e.getMessage());
return new ValidationResultMutable(Result.ERROR, e.getMessage());
}
}
}
Aggregations