// S3ClientRequest.java
public S3ClientRequest createPutRequest(String bucket, String key, Handler<HttpClientResponse> handler) { HttpClientRequest httpRequest = client.put("/" + key, handler); return new S3ClientRequest("PUT", bucket, key, httpRequest, awsAccessKey, awsSecretKey);}
...
// S3Client.java
public void put(String bucket, String key, Buffer data, Handler<HttpClientResponse> handler) { S3ClientRequest request = createPutRequest(bucket, key, handler); request.end(data);}...
// main verticle
Buffer toUpload = Buffer.buffer("upload this to s3");
final S3Client s3Client = new S3Client("private", "thingie"); s3Client.put("bucketname", "key", toUpload, response -> { int status = response.statusCode();});
// S3Client.java
public void put(String bucket, String key, HttpServerFileUpload upload, Handler<HttpClientResponse> handler) { S3ClientRequest request = createPutRequest(bucket, key, handler); // same method as above Pump pump = Pump.pump(upload, request); pump.start();}
...
// main verticle
requestEvent.uploadHandler(fileUploadEvent -> s3Client.put("bucket", "mykey", fileUploadEvent, awsResponseEvent -> { int status = awsResponseEvent.statusCode(); }));
--
thanks
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/508b8d91-dd15-4e4f-9eb8-e6f6e4347555%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.