2

If I want to have a ftp custom component in apache-camel, how to set the ftp uri parameter to ftpConfiguration ? I have try to used a Uri param annotation to get the uri parameter but failed. Does anyone have idea ? Below is my sample code:

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;
    }
}
ParkerHalo
  • 4,341
  • 9
  • 29
  • 51
hk6279
  • 1,881
  • 2
  • 22
  • 32

1 Answers1

0

As Claus Ibsen wrote you should change your code to:

@UriParams
public class FtpConfigurationExt extends FtpConfiguration {
  // ...
}
PowerStat
  • 3,757
  • 8
  • 32
  • 57