@@ -1068,10 +1068,18 @@ public interface IObjectStorageProvider
10681068 /// Creates an object using data from a file. If the destination file already exists, the contents are overwritten.
10691069 /// </summary>
10701070 /// <remarks>
1071+ /// <para>
10711072 /// The content type for the object may be specified by providing the <paramref name="contentType"/> argument,
10721073 /// or by setting <see cref="CloudFilesProvider.DetectContentType"/> to <c>True</c> in the
10731074 /// <paramref name="headers"/> argument. If neither of these is used, the resulting content type of the object
10741075 /// is unspecified.
1076+ /// </para>
1077+ /// <para>
1078+ /// Object metadata can be set at the time the object is created by including the custom metadata items in the
1079+ /// <paramref name="headers"/> argument. Note that unlike the <see cref="UpdateObjectMetadata"/> method, the
1080+ /// keys of all custom metadata items included as headers must be prefixed with
1081+ /// <see cref="CloudFilesProvider.ObjectMetaDataPrefix"/>.
1082+ /// </para>
10751083 /// </remarks>
10761084 /// <param name="container">The container name.</param>
10771085 /// <param name="filePath">The source file path. Example <localUri>c:\folder1\folder2\image_name.jpeg</localUri></param>
@@ -1112,6 +1120,12 @@ public interface IObjectStorageProvider
11121120 /// <para>If <paramref name="region"/> is <see langword="null"/> and no default region is available for the provider.</para>
11131121 /// </exception>
11141122 /// <exception cref="ResponseException">If the REST API request failed.</exception>
1123+ /// <example>
1124+ /// The following code shows two ways to create an object with custom metadata. The first uses the <paramref name="headers"/>
1125+ /// argument to this method, and the second shows an alternative method of calling <see cref="UpdateObjectMetadata"/> after
1126+ /// the object is created.
1127+ /// <code source="..\Samples\CSharpCodeSamples\ObjectStorageProviderExamples.cs" region="CreateObjectFromFileWithMetadata" language="cs"/>
1128+ /// </example>
11151129 /// <seealso cref="CloudFilesProvider.DetectContentType"/>
11161130 /// <seealso href="http://docs.openstack.org/api/openstack-object-storage/1.0/content/PUT_createOrReplaceObject_v1__account___container___object__storage_object_services.html">Create or replace object (OpenStack Object Storage API v1 Reference)</seealso>
11171131 void CreateObjectFromFile ( string container , string filePath , string objectName = null , string contentType = null , int chunkSize = 65536 , Dictionary < string , string > headers = null , string region = null , Action < long > progressUpdated = null , bool useInternalUrl = false , CloudIdentity identity = null ) ;
@@ -1120,10 +1134,18 @@ public interface IObjectStorageProvider
11201134 /// Creates an object using data from a <see cref="Stream"/>. If the destination file already exists, the contents are overwritten.
11211135 /// </summary>
11221136 /// <remarks>
1137+ /// <para>
11231138 /// The content type for the object may be specified by providing the <paramref name="contentType"/> argument,
11241139 /// or by setting <see cref="CloudFilesProvider.DetectContentType"/> to <c>True</c> in the
11251140 /// <paramref name="headers"/> argument. If neither of these is used, the resulting content type of the object
11261141 /// is unspecified.
1142+ /// </para>
1143+ /// <para>
1144+ /// Object metadata can be set at the time the object is created by including the custom metadata items in the
1145+ /// <paramref name="headers"/> argument. Note that unlike the <see cref="UpdateObjectMetadata"/> method, the
1146+ /// keys of all custom metadata items included as headers must be prefixed with
1147+ /// <see cref="CloudFilesProvider.ObjectMetaDataPrefix"/>.
1148+ /// </para>
11271149 /// </remarks>
11281150 /// <param name="container">The container name.</param>
11291151 /// <param name="stream">A <see cref="Stream"/> providing the data for the file.</param>
@@ -1165,6 +1187,12 @@ public interface IObjectStorageProvider
11651187 /// <para>If <paramref name="region"/> is <see langword="null"/> and no default region is available for the provider.</para>
11661188 /// </exception>
11671189 /// <exception cref="ResponseException">If the REST API request failed.</exception>
1190+ /// <example>
1191+ /// The following code shows two ways to create an object with custom metadata. The first uses the <paramref name="headers"/>
1192+ /// argument to this method, and the second shows an alternative method of calling <see cref="UpdateObjectMetadata"/> after
1193+ /// the object is created.
1194+ /// <code source="..\Samples\CSharpCodeSamples\ObjectStorageProviderExamples.cs" region="CreateObjectWithMetadata" language="cs"/>
1195+ /// </example>
11681196 /// <seealso cref="CloudFilesProvider.DetectContentType"/>
11691197 /// <seealso href="http://docs.openstack.org/api/openstack-object-storage/1.0/content/PUT_createOrReplaceObject_v1__account___container___object__storage_object_services.html">Create or replace object (OpenStack Object Storage API v1 Reference)</seealso>
11701198 void CreateObject ( string container , Stream stream , string objectName , string contentType = null , int chunkSize = 65536 , Dictionary < string , string > headers = null , string region = null , Action < long > progressUpdated = null , bool useInternalUrl = false , CloudIdentity identity = null ) ;
0 commit comments