Skip to content

Instantly share code, notes, and snippets.

package com.example.demo
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RestController
import java.util.*
@RestController
class DemoController {
from("timer://foo?repeatCount=1").setProperty("folder",constant("folder1")).
process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
String folder = exchange.getProperty("folder",String.class);
String basePath="inbox/";
ZipUtil.pack(new File(basePath+folder), new File(basePath+folder+".zip"));
}
}).pollEnrich().simple("file:inbox?fileName=${property.folder}.zip")
.toD("ftp://pi@192.168.2.3:21/files/?password=raspberry&binary=true")