use of org.apache.camel.component.file.remote.FtpComponent in project camel by apache.
the class FtpComponentAutoConfiguration method configureFtpComponent.
@Lazy
@Bean(name = "ftp-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(FtpComponent.class)
public FtpComponent configureFtpComponent(CamelContext camelContext) throws Exception {
FtpComponent component = new FtpComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.apache.camel.component.file.remote.FtpComponent in project camel by apache.
the class FtpComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
FtpComponent comp = context.getComponent("ftp", FtpComponent.class);
EndpointConfiguration conf = comp.createConfiguration("ftp://myhost?username=foo&password=secret&soTimeout=1234");
assertEquals("foo", conf.getParameter("username"));
assertEquals("secret", conf.getParameter("password"));
assertEquals("1234", conf.getParameter("soTimeout"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"minDepth\": { \"kind\": \"parameter\", \"displayName\": \"Min Depth\", \"group\": \"filter\", \"label\": \"consumer,filter\", \"type\": \"integer\", \"javaType\": \"int\""));
assertTrue(json.contains("\"username\": { \"kind\": \"parameter\", \"displayName\": \"Username\", \"group\": \"security\", \"label\": \"security\", \"type\": \"string\""));
}
Aggregations