I am using apache camel for this.I have an http server. When I do a get request on a url it should fetch a file from a bucket in aws s3 and then create a file in my local directory.
public static class HelloRoute extends RouteBuilder {
@Override
public void configure() {
rest("/")
.get("file-from-s3")
.route()
.from("aws2-s3://bucketname?accessKey=INSERT&secretKey=INSERT®ion=us-east-1&prefix=hello.txt")
.to("file:/tmp/")
.endRest();
}
I wrote the above code for this but it looks like it's ignoring the "from" statement and directly executing the "to" statement and hence creating an empty file in my tmp directory. Is there some other way to do this?