Class: Actions::Pulp::Repository::UploadFile

Inherits:
Abstract
  • Object
show all
Defined in:
app/lib/actions/pulp/repository/upload_file.rb

Instance Method Summary collapse

Methods inherited from Abstract

#pulp_extensions, #pulp_resources

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
# File 'app/lib/actions/pulp/repository/upload_file.rb', line 10

def run
  File.open(input[:file], "rb") do |file|
    offset = 0
    while (chunk = file.read(upload_chunk_size))
      pulp_resources.content.upload_bits(input[:upload_id], offset, chunk)
      offset += upload_chunk_size
    end
  end
end