'Download an object to the specified destination path.
:param obj: Object instance.
:type obj: :class:`Object`
:param destination_path: Full path to a file or a directory where the
incoming file will be saved.
:type destination_path: ``str``
:param overwrite_existing: True to overwrite an existing file,
defaults to False.
:type overwrite_existing: ``bool``
:param delete_on_failure: True to delete a partially downloaded file if
the download was not successful (hash mismatch / file size).
:type delete_on_failure: ``bool``
:return: True if an object has been successfully downloaded, False
otherwise.
:rtype: ``bool``'

def download_object(self, obj, destination_path, overwrite_existing=False, delete_on_failure=True):

    obj_path = self.get_object_cdn_url(obj)
    base_name = os.path.basename(destination_path)
    if ((not base_name) and (not os.path.exists(destination_path))):
        raise LibcloudError(value=('Path    %s    does    not    exist' % destination_path), driver=self)
    if (not base_name):
        file_path = os.path.join(destination_path, obj.name)
    else:
        file_path = destination_path
    if (os.path.exists(file_path) and (not overwrite_existing)):
        raise LibcloudError(value=(('File    %s    already    exists,    but    ' % file_path) + 'overwrite_existing=False'), driver=self)
    try:
        shutil.copy(obj_path, file_path)
    except IOError:
        if delete_on_failure:
            try:
                os.unlink(file_path)
            except Exception:
                pass
        return False
    return True
