Class: AwsCli::CLI::Sss::Files

Inherits:
Thor
  • Object
show all
Defined in:
lib/awscli/cli/s3/files.rb

Instance Method Summary collapse

Instance Method Details

#copyObject



75
76
77
78
# File 'lib/awscli/cli/s3/files.rb', line 75

def copy
  create_s3_object
  @s3.copy_file options[:source_bucket], options[:source_file], options[:dest_bucket], options[:dest_file]
end

#deleteObject



65
66
67
68
# File 'lib/awscli/cli/s3/files.rb', line 65

def delete
  create_s3_object
  @s3.delete_file options[:bucket_name], options[:file_name]
end

#getObject



57
58
59
60
# File 'lib/awscli/cli/s3/files.rb', line 57

def get
  create_s3_object
  @s3.download_file options[:bucket_name], options[:file_name], options[:local_path]
end

#listObject



10
11
12
13
# File 'lib/awscli/cli/s3/files.rb', line 10

def list
  create_s3_object
  @s3.list options[:bucket_name], options[:prefix]
end

#public_urlObject



83
84
85
86
# File 'lib/awscli/cli/s3/files.rb', line 83

def public_url
  create_s3_object
  @s3.get_public_url options[:bucket_name], options[:file_name]
end

#putObject



19
20
21
22
23
24
25
26
# File 'lib/awscli/cli/s3/files.rb', line 19

def put
  create_s3_object
  if options[:dest_path]
    @s3.upload_file options[:bucket_name], options[:file_path], options[:dest_path]
  else
    @s3.upload_file options[:bucket_name], options[:file_path]
  end
end

#put_bigObject



48
49
50
51
# File 'lib/awscli/cli/s3/files.rb', line 48

def put_big
  create_s3_object
  @s3.multipart_upload options
end

#put_recObject



34
35
36
37
# File 'lib/awscli/cli/s3/files.rb', line 34

def put_rec
  create_s3_object
  @s3.upload_file_rec options
end