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: MultipartProgress, 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 )
- COMPLETE_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(:complete_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 = {}) ⇒ Seahorse::Client::Response
private
-
the CompleteMultipartUploadResponse.
-
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.
35 36 37 38 |
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 35 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.
41 42 43 |
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 41 def client @client end |
Instance Method Details
#upload(source, options = {}) ⇒ Seahorse::Client::Response
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 - the CompleteMultipartUploadResponse.
50 51 52 53 54 55 56 57 58 |
# File 'lib/aws-sdk-s3/multipart_file_uploader.rb', line 50 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 |