Skip to content

Instantly share code, notes, and snippets.

@ltsallas
Last active July 3, 2016 19:20
Show Gist options
  • Save ltsallas/6096624aed65ce06bb65c86add125c75 to your computer and use it in GitHub Desktop.
Save ltsallas/6096624aed65ce06bb65c86add125c75 to your computer and use it in GitHub Desktop.
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")
.setBody(simple("unzip /home/pi/ftp/files/${property.folder}.zip -d /home/pi/ftp/files/${property.folder}/ && rm /home/pi/ftp/files/${property.folder}.zip"))
.to("ssh://pi:raspberry@192.168.2.3");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment