2828
2929namespace Amazon . S3 . Transfer
3030{
31+ /// <summary>
32+ /// Specifies the strategy for multipart downloads
33+ /// </summary>
34+ public enum MultipartDownloadType
35+ {
36+ /// <summary>
37+ /// Use part-based downloads with original upload part boundaries
38+ /// </summary>
39+ PART ,
40+
41+ /// <summary>
42+ /// Use range-based downloads with configurable part sizes
43+ /// </summary>
44+ RANGE
45+ }
46+
3147 /// <summary>
3248 /// The base class for requests that return Amazon S3 objects.
3349 /// </summary>
@@ -50,6 +66,8 @@ public abstract class BaseDownloadRequest
5066 private string ifMatch ;
5167 private string ifNoneMatch ;
5268 private ResponseHeaderOverrides responseHeaders ;
69+ private long ? partSize ;
70+ private MultipartDownloadType multipartDownloadType = MultipartDownloadType . PART ;
5371
5472 /// <summary>
5573 /// Gets or sets the name of the bucket.
@@ -330,5 +348,45 @@ public ResponseHeaderOverrides ResponseHeaderOverrides
330348 this . responseHeaders = value ;
331349 }
332350 }
351+
352+ /// <summary>
353+ /// Gets or sets the part size of the download in bytes.
354+ /// The downloaded file will be divided into
355+ /// parts the size specified and
356+ /// downloaded from Amazon S3 individually.
357+ /// This is used when MultipartDownloadType is set to RANGE.
358+ /// </summary>
359+ /// <value>
360+ /// The part size of the download.
361+ /// </value>
362+ public long PartSize
363+ {
364+ get { return this . partSize . GetValueOrDefault ( ) ; }
365+ set { this . partSize = value ; }
366+ }
367+
368+ /// <summary>
369+ /// Checks if PartSize property is set.
370+ /// </summary>
371+ /// <returns>true if PartSize property is set.</returns>
372+ internal bool IsSetPartSize ( )
373+ {
374+ return this . partSize . HasValue ;
375+ }
376+
377+ /// <summary>
378+ /// Gets or sets the type of multipart download to use.
379+ /// PART: Uses part GET with original part sizes from upload (ignores PartSize)
380+ /// RANGE: Uses ranged GET with PartSize to determine ranges
381+ /// Default is PART
382+ /// </summary>
383+ /// <value>
384+ /// The multipart download type.
385+ /// </value>
386+ public MultipartDownloadType MultipartDownloadType
387+ {
388+ get { return this . multipartDownloadType ; }
389+ set { this . multipartDownloadType = value ; }
390+ }
333391 }
334- }
392+ }
0 commit comments