'Check if the dest_file already exists on the file system (return boolean).'

def check_file_exists(self, remote_cmd=u''):

    if (self.direction == u'put'):
        if (not remote_cmd):
            remote_cmd = u'dir    {0}/{1}'.format(self.file_system, self.dest_file)
        remote_out = self.ssh_ctl_chan.send_command_expect(remote_cmd)
        search_string = u'Directory    of    .*{0}'.format(self.dest_file)
        if (u'Error    opening' in remote_out):
            return False
        elif re.search(search_string, remote_out):
            return True
        else:
            raise ValueError(u'Unexpected    output    from    check_file_exists')
    elif (self.direction == u'get'):
        return os.path.exists(self.dest_file)
