如果我想在apache-camel中有一个ftp自定义组件,如何将ftp uri参数设置为ftpConfiguration?我尝试使用Uri param注解来获取uri参数,但是失败了。有人知道吗?下面是我的示例代码:
public class FtpConfigurationExt extends FtpConfiguration {
private static final Logger LOGGER = LoggerFactory.getLogger(FtpConfigurationExt.class);
@UriParam(name = "ftpCommands")
private String ftpCommands;
public FtpConfigurationExt() {
super();
}
public FtpConfigurationExt(URI uri) {
super(uri);
setProtocol("ftp");
}
public String getFtpCommands() {
return ftpCommands;
}
public void setFtpCommands(String ftpCommands) {
LOGGER.info(" FtpConfigurationExt ftpCommands : " + ftpCommands);
this.ftpCommands = ftpCommands;
}
}
1条答案
按热度按时间goucqfw61#
正如Claus Ibsen所写,您应该将代码更改为: