@@ -2,6 +2,7 @@ namespace DotNet.Testcontainers.Builders
2
2
{
3
3
using System ;
4
4
using System . Collections . Generic ;
5
+ using System . IO ;
5
6
using System . Threading ;
6
7
using System . Threading . Tasks ;
7
8
using Docker . DotNet . Models ;
@@ -200,29 +201,62 @@ public interface IContainerBuilder<out TBuilderEntity, out TContainerEntity> : I
200
201
TBuilderEntity WithPortBinding ( string hostPort , string containerPort ) ;
201
202
202
203
/// <summary>
203
- /// Copies the source file to the created container before it starts.
204
+ /// Copies the byte array content of the resource mapping to the created container before it starts.
204
205
/// </summary>
205
- /// <param name="source">An absolute path or a name value within the host machine.</param>
206
- /// <param name="destination">An absolute path as destination in the container.</param>
206
+ /// <param name="resourceMapping">The resource mapping.</param>
207
207
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
208
208
[ PublicAPI ]
209
- TBuilderEntity WithResourceMapping ( string source , string destination ) ;
209
+ TBuilderEntity WithResourceMapping ( IResourceMapping resourceMapping ) ;
210
210
211
211
/// <summary>
212
212
/// Copies the byte array content to the created container before it starts.
213
213
/// </summary>
214
214
/// <param name="resourceContent">The byte array content of the resource mapping.</param>
215
- /// <param name="destination">An absolute path as destination in the container.</param>
215
+ /// <param name="filePath">The target file path to copy the file to.</param>
216
+ /// <param name="fileMode">The POSIX file mode permission.</param>
216
217
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
217
218
[ PublicAPI ]
218
- TBuilderEntity WithResourceMapping ( byte [ ] resourceContent , string destination ) ;
219
+ TBuilderEntity WithResourceMapping ( byte [ ] resourceContent , string filePath , UnixFileModes fileMode = Unix . FileMode644 ) ;
219
220
220
221
/// <summary>
221
- /// Copies the byte array content of the resource mapping to the created container before it starts.
222
+ /// Copies a test host directory or file to the container before it starts.
222
223
/// </summary>
223
- /// <param name="resourceMapping">The resource mapping.</param>
224
+ /// <param name="source">The source directory or file to be copied.</param>
225
+ /// <param name="target">The target directory path to copy the files to.</param>
226
+ /// <param name="fileMode">The POSIX file mode permission.</param>
224
227
/// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
225
- TBuilderEntity WithResourceMapping ( IResourceMapping resourceMapping ) ;
228
+ [ PublicAPI ]
229
+ TBuilderEntity WithResourceMapping ( string source , string target , UnixFileModes fileMode = Unix . FileMode644 ) ;
230
+
231
+ /// <summary>
232
+ /// Copies a test host directory or file to the container before it starts.
233
+ /// </summary>
234
+ /// <param name="source">The source directory to be copied.</param>
235
+ /// <param name="target">The target directory path to copy the files to.</param>
236
+ /// <param name="fileMode">The POSIX file mode permission.</param>
237
+ /// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
238
+ [ PublicAPI ]
239
+ TBuilderEntity WithResourceMapping ( DirectoryInfo source , string target , UnixFileModes fileMode = Unix . FileMode644 ) ;
240
+
241
+ /// <summary>
242
+ /// Copies a test host directory or file to the container before it starts.
243
+ /// </summary>
244
+ /// <param name="source">The source file to be copied.</param>
245
+ /// <param name="target">The target directory path to copy the file to.</param>
246
+ /// <param name="fileMode">The POSIX file mode permission.</param>
247
+ /// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
248
+ [ PublicAPI ]
249
+ TBuilderEntity WithResourceMapping ( FileInfo source , string target , UnixFileModes fileMode = Unix . FileMode644 ) ;
250
+
251
+ /// <summary>
252
+ /// Copies a test host file to the container before it starts.
253
+ /// </summary>
254
+ /// <param name="source">The source file to be copied.</param>
255
+ /// <param name="target">The target file path to copy the file to.</param>
256
+ /// <param name="fileMode">The POSIX file mode permission.</param>
257
+ /// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
258
+ [ PublicAPI ]
259
+ TBuilderEntity WithResourceMapping ( FileInfo source , FileInfo target , UnixFileModes fileMode = Unix . FileMode644 ) ;
226
260
227
261
/// <summary>
228
262
/// Assigns the mount configuration to manage data in the container.
0 commit comments