From c0c0287b8d8dc304bca2e998a84c1a29cb59ae8f Mon Sep 17 00:00:00 2001 From: Gabriel Cebrian Date: Sat, 31 May 2014 16:38:42 -0700 Subject: [PATCH 1/2] Make the putS3ObjectRequest public to allow for further customization of the S3 request's headers and parameters --- OWS3Client/OWS3Client.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OWS3Client/OWS3Client.h b/OWS3Client/OWS3Client.h index f0f3f4e..f9c6765 100644 --- a/OWS3Client/OWS3Client.h +++ b/OWS3Client/OWS3Client.h @@ -122,4 +122,22 @@ cacheControl:(NSString*)cacheControl success:(void (^)(S3PutObjectResponse *responseObject))success failure:(void (^)(NSError *error))failure; + +/** + Adds an object to a bucket using forms. + + @param data The data you want to upload. + @param bucket The destination bucket. + @param key Optional. Defaults to the last path component of `path`. + @param acl Optional. If unset it uses the global value for acl which defaults to public-read. You probably want either public-read or private. For more info check out S3CannedACL.h in aws-sdk-ios. + @param cacheControl Optional. Can be useful for frequently-changing objects behind Cloudfront. + @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single argument: the response object from the server. + @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the `NSError` object describing error that occurred. + */ +- (void) putS3ObjectRequest:(S3PutObjectRequest*)request + acl:(NSString*)acl + cacheControl:(NSString *)cacheControl + success:(void (^)(S3PutObjectResponse *responseObject))success + failure:(void (^)(NSError *error))failure; + @end From 43cb3cd62ae8861bae4b262eff39bbb881a9343b Mon Sep 17 00:00:00 2001 From: Gabriel Cebrian Date: Sat, 31 May 2014 16:42:27 -0700 Subject: [PATCH 2/2] Fixes the method documentation --- OWS3Client/OWS3Client.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OWS3Client/OWS3Client.h b/OWS3Client/OWS3Client.h index f9c6765..236fb5c 100644 --- a/OWS3Client/OWS3Client.h +++ b/OWS3Client/OWS3Client.h @@ -124,11 +124,9 @@ failure:(void (^)(NSError *error))failure; /** - Adds an object to a bucket using forms. + Submits an S3PutObjectRequest to Amazon S3 using forms - @param data The data you want to upload. - @param bucket The destination bucket. - @param key Optional. Defaults to the last path component of `path`. + @param request The S3PutObjectRequest to submit to Amazon. @param acl Optional. If unset it uses the global value for acl which defaults to public-read. You probably want either public-read or private. For more info check out S3CannedACL.h in aws-sdk-ios. @param cacheControl Optional. Can be useful for frequently-changing objects behind Cloudfront. @param success A block object to be executed when the request operation finishes successfully. This block has no return value and takes a single argument: the response object from the server.