| 661 | end |
| 662 | |
| 663 | def upload(path, destination_path) |
| 664 | destination_url = build_deployed_url(destination_path) |
| 665 | with_retry(3, destination_url) do |
| 666 | sha1 = Digest::SHA1.file(path).hexdigest |
| 667 | sha256 = Digest::SHA256.file(path).hexdigest |
| 668 | headers = { |
| 669 | "X-Artifactory-Last-Modified" => File.mtime(path).rfc2822, |
| 670 | "X-Checksum-Deploy" => "false", |
| 671 | "X-Checksum-Sha1" => sha1, |
| 672 | "X-Checksum-Sha256" => sha256, |
| 673 | "Content-Length" => File.size(path).to_s, |
| 674 | "Content-Type" => "application/octet-stream", |
| 675 | } |
| 676 | File.open(path, "rb") do |input| |
| 677 | request(:put, headers, destination_url, body: input) |
| 678 | end |
| 679 | end |
| 680 | end |
| 681 | |
| 682 | def copy(source, destination) |
| 683 | url = build_api_url("copy/arrow/#{source}", |