def METHOD_NAME(self, task, config):
    if not imported:
        raise DependencyError('ftp_list', 'ftp_list', 'ftputil is required for this plugin')
    config = self.prepare_config(config)
    self.username = config.get('username')
    self.password = config.get('password')
    self.host = config.get('host')
    self.port = config.get('port')
    directories = config.get('dirs')
    recursion = config.get('recursion')
    content_types = config.get('retrieve')
    recursion_depth = -1 if recursion else 0
    base_class = ftplib.FTP_TLS if config.get('ssl') else ftplib.FTP
    session_factory = ftputil.session.session_factory(port=self.port, base_class=base_class)
    try:
        logger.verbose(
            'trying to establish connection to FTP: {}:<HIDDEN>@{}:{}',
            self.username,
            self.host,
            self.port,
        )
        self.FTP = ftputil.FTPHost(
            self.host, self.username, self.password, session_factory=session_factory
        )
    except FTPOSError as e:
        raise PluginError(f'Could not connect to FTP: {e.args[0]}')
    entries = []
    for d in directories:
        for content in self.get_content(d, recursion, recursion_depth, content_types):
            entries.append(self._to_entry(content))
    return entries