转移文件

@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
@ServletComponentScan(basePackages = "com.iflytek.jtcn.vio")
@ImportResource(locations= {"classpath:spring-config.xml"})
public class VioToFtpApplication{

	private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(VioToFtpApplication.class);
	
	@Bean
	public void initData() throws Exception {

		CamelContext context = new DefaultCamelContext();
		context.addRoutes(new RouteBuilder() {
			public void configure() {
				from("file:d:/test7").to("file:d:/test8");//这句话是核心
			}
		});
		context.start();

	}


	public static void main(String[] args) {
		log.info("camel组件启动成功:"+new Date());
		SpringApplication.run(VioToFtpApplication.class, args);

	}
}

  

原文地址:https://www.cnblogs.com/shenhaha520/p/13667149.html