コード例 #1
0
        /// <summary>
        /// Writes an object to S3.
        /// </summary>
        /// <param name="bucket">The name of the bucket to which the object will be added.</param>
        /// <param name="key">The name of the key to use</param>
        /// <param name="obj">Object to write</param>
        /// <param name="accessControlList">Access Control List (can be null)</param>
        /// <param name="metadata">Metadata (can be null)</param>
        public PutObjectResult put(string bucket, string key, string obj, MetadataEntry[] metadata, Grant[] accessControlList)
        {
            DateTime      timestamp = AWSDateFormatter.GetCurrentTimeResolvedToMillis();
            string        signature = makeSignature("PutObjectInline", timestamp);
            ASCIIEncoding ae        = new ASCIIEncoding();

            return(s3.PutObjectInline(bucket, key, metadata, ae.GetBytes(obj), obj.Length, accessControlList,
                                      StorageClass.STANDARD, false,
                                      awsAccessKeyId, timestamp, true, signature, null));
        }