private void setAcl ( String bucketName , String key , String versionId , CannedAccessControlList cannedAcl , boolean isRequesterPays , AmazonWebServiceRequest originalRequest ) { if ( originalRequest == null ) originalRequest = new GenericBucketRequest ( bucketName ) ; Request < AmazonWebServiceRequest > request = createRequest ( bucketName , key , originalRequest , HttpMethodName . PUT ) ; if ( bucketName != null && key != null ) { request . addHandlerContext ( HandlerContextKey . OPERATION_NAME , "PutObjectAcl" ) ; } else if ( bucketName != null ) { request . addHandlerContext ( HandlerContextKey . OPERATION_NAME , "PutBucketAcl" ) ; } request . addParameter ( "acl" , null ) ; request . addHeader ( Headers . S3_CANNED_ACL , cannedAcl . toString ( ) ) ; if ( versionId != null ) request . addParameter ( "versionId" , versionId ) ; populateRequesterPaysHeader ( request , isRequesterPays ) ; invoke ( request , voidResponseHandler , bucketName , key ) ; }
Sets the Canned ACL for the specified resource in S3 . If only bucketName is specified the canned ACL will be applied to the bucket otherwise if bucketName and key are specified the canned ACL will be applied to the object .