Class: Aws::S3::MultipartFileUploader Private
- Inherits:
-
Object
- Object
- Aws::S3::MultipartFileUploader
- Defined in:
- lib/aws-sdk-s3/multipart_file_uploader.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: PartList
Constant Summary collapse
- MIN_PART_SIZE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
5MB
5 * 1024 * 1024
- FILE_TOO_SMALL =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"unable to multipart upload files smaller than 5MB"
- MAX_PARTS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
10_000
- THREAD_COUNT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
10
- CREATE_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Set.new(Client.api.operation(:create_multipart_upload).input.shape.member_names)
- UPLOAD_PART_OPTIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Set.new(Client.api.operation(:upload_part).input.shape.member_names)
Instance Attribute Summary collapse
- #client ⇒ Client readonly private
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ MultipartFileUploader
constructor
private
A new instance of MultipartFileUploader.
- #upload(source, options = {}) ⇒ void private
Constructor Details
#initialize(options = {}) ⇒ MultipartFileUploader
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MultipartFileUploader.
27 28 29 30 |
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 27 def initialize( = {}) @client = [:client] || Client.new @thread_count = [:thread_count] || THREAD_COUNT end |
Instance Attribute Details
#client ⇒ Client (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 33 def client @client end |
Instance Method Details
#upload(source, options = {}) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
39 40 41 42 43 44 45 46 47 |
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 39 def upload(source, = {}) if File.size(source) < MIN_PART_SIZE raise ArgumentError, FILE_TOO_SMALL else upload_id = initiate_upload() parts = upload_parts(upload_id, source, ) complete_upload(upload_id, parts, ) end end |