'Download a file via HTTP.  If the value of initial_download is True, the recipe steps will be
filtered and returned and the installation directory (i.e., dir) will be defined and returned.
If we\'re not in the initial download stage, these actions will not occur, and None values will
be returned for them.'

def execute_step(self, tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False):

    if initial_download:
        filtered_actions = actions[1:]
    url = action_dict['url']
    is_binary = action_dict.get('is_binary', False)
    if ('target_filename' in action_dict):
        downloaded_filename = action_dict['target_filename']
    else:
        downloaded_filename = os.path.split(url)[(-1)]
    checksums = self.get_dict_checksums(action_dict)
    log.debug('Attempting    to    download    via    url:    %s', url)
    dir = self.url_download(work_dir, downloaded_filename, url, extract=True, checksums=checksums)
    if is_binary:
        log_file = os.path.join(install_environment.install_dir, basic_util.INSTALLATION_LOG)
        if os.path.exists(log_file):
            logfile = open(log_file, 'ab')
        else:
            logfile = open(log_file, 'wb')
        logfile.write(('Successfully    downloaded    from    url:    %s\n' % action_dict['url']))
        logfile.close()
    log.debug(('Successfully    downloaded    from    url:    %s' % action_dict['url']))
    if initial_download:
        return (tool_dependency, filtered_actions, dir)
    return (tool_dependency, None, None)
