def upload(repo, remote_path, properties = {}, headers = {})
      file     = File.new(File.expand_path(local_path))
      matrix   = to_matrix_properties(properties)
      endpoint = File.join("#{url_safe(repo)}#{matrix}", remote_path)

      # Include checksums in headers if given.
      headers["X-Checksum-Md5"] = md5   if md5
      headers["X-Checksum-Sha1"] = sha1 if sha1

      response = client.put(endpoint, file, headers)

      return unless response.is_a?(Hash)
      self.class.from_hash(response)
    end
def upload(repo, remote_path, properties = {}, headers = {})
      file     = File.new(File.expand_path(local_path))
      matrix   = to_matrix_properties(properties)
      endpoint = File.join("#{url_safe(repo)}#{matrix}", remote_path)

      # Include checksums in headers if given.
      headers["X-Checksum-Md5"] = md5   if md5
      headers["X-Checksum-Sha1"] = sha1 if sha1

      response = client.put(endpoint, file, headers)

      return unless response.is_a?(Hash)
      self.class.from_hash(response)
    end
Upload an artifact into the repository. If the first parameter is a File
 object, that file descriptor is passed to the uploader. If the first
 parameter is a string, it is assumed to be the path to a local file on
 disk. This method will automatically construct the File object from the
 given path.

 @see bit.ly/1dhJRMO Artifactory Matrix Properties

 @example Upload an artifact from a File instance
   artifact = Artifact.new(local_path: '/local/path/to/file.deb')
   artifact.upload('libs-release-local', '/remote/path')

 @example Upload an artifact with matrix properties
   artifact = Artifact.new(local_path: '/local/path/to/file.deb')
   artifact.upload('libs-release-local', '/remote/path', {
     status: 'DEV',
     rating: 5,
     branch: 'master'
   })

 @param [String] repo
   the key of the repository to which to upload the file
 @param [String] remote_path
   the path where this resource will live in the remote artifactory
   repository, relative to the repository key
 @param [Hash] headers
   the list of headers to send with the request
 @param [Hash] properties
   a list of matrix properties

 @return [Resource::Artifact]