Class: Aws::S3::FileUploader Private
- Inherits:
-
Object
- Object
- Aws::S3::FileUploader
- Defined in:
- lib/aws-sdk-s3/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.
Constant Summary collapse
- FIFTEEN_MEGABYTES =
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.
15 * 1024 * 1024
Instance Attribute Summary collapse
- #client ⇒ Client readonly private
-
#multipart_threshold ⇒ Integer
readonly
private
Files larger than this in bytes are uploaded using a MultipartFileUploader.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ FileUploader
constructor
private
A new instance of FileUploader.
- #upload(source, options = {}) ⇒ void private
Constructor Details
#initialize(options = {}) ⇒ FileUploader
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 FileUploader.
13 14 15 16 17 18 |
# File 'lib/aws-sdk-s3/file_uploader.rb', line 13 def initialize( = {}) @options = @client = [:client] || Client.new @multipart_threshold = [:multipart_threshold] || FIFTEEN_MEGABYTES 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.
21 22 23 |
# File 'lib/aws-sdk-s3/file_uploader.rb', line 21 def client @client end |
#multipart_threshold ⇒ Integer (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.
Returns Files larger than this in bytes are uploaded using a MultipartFileUploader.
25 26 27 |
# File 'lib/aws-sdk-s3/file_uploader.rb', line 25 def multipart_threshold @multipart_threshold 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.
31 32 33 34 35 36 37 |
# File 'lib/aws-sdk-s3/file_uploader.rb', line 31 def upload(source, = {}) if File.size(source) >= multipart_threshold MultipartFileUploader.new(@options).upload(source, ) else put_object(source, ) end end |