TyrantLucifer commented on code in PR #2483:
URL:
https://github.com/apache/incubator-seatunnel/pull/2483#discussion_r950846742
##########
seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/ftp/FtpFileSink.java:
##########
@@ -39,11 +45,19 @@ public SinkFileSystemPlugin getSinkFileSystemPlugin() {
public void prepare(Config pluginConfig) throws PrepareFailException {
super.prepare(pluginConfig);
- FtpFileUtils.FTP_HOST =
String.valueOf(pluginConfig.getString("ftp_host"));
- FtpFileUtils.FTP_USERNAME =
String.valueOf(pluginConfig.getString("ftp_username"));
- FtpFileUtils.FTP_PASSWORD =
String.valueOf(pluginConfig.getString("ftp_password"));
- FtpFileUtils.FTP_PORT = pluginConfig.getInt("ftp_port");
- FtpFileUtils.getFTPClient();
+ if (pluginConfig.hasPath(FtpConfig.FTP_HOST)) {
Review Comment:
In common module, seatunnel has a util to check config parameters
conveniently. This is an example:
```java
CheckResult result = CheckConfigUtil.checkAllExists(pluginConfig,
HttpConfig.URL);
if (!result.isSuccess()) {
throw new PrepareFailException(getPluginName(),
PluginType.SOURCE, result.getMsg());
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]