if ("ftp".equals(config.getProtocol())) {
endpoint = new FtpEndpoint(uri, this, config);
} else if ("sftp".equals(config.getProtocol())) {
endpoint = new SftpEndpoint(uri, this, config);
} else {
throw new RuntimeCamelException("Unsupported protocol: " + config.getProtocol());
}
IntrospectionSupport.setProperties(endpoint.getConfiguration(), parameters);
return endpoint;
}