linkcheck.checker.ftpurl

Handle FTP links.

Classes

FtpUrl(base_url, recursion_level, aggregate)

Url link with ftp scheme.

class linkcheck.checker.ftpurl.FtpUrl(base_url, recursion_level, aggregate, parent_url=None, base_ref=None, line=-1, column=-1, page=-1, name='', url_encoding=None, extern=None)[source]

Bases: InternPatternUrl

Url link with ftp scheme.

Initialize check data, and store given variables.

Parameters:
  • base_url – unquoted and possibly unnormed url

  • recursion_level – on what check level lies the base url

  • aggregate – aggregate instance

  • parent_url – quoted and normed url of parent or None

  • base_ref – quoted and normed url of <base href=””> or None

  • line – line number of url in parent content

  • column – column number of url in parent content

  • page – page number of url in parent content

  • name – name of url or empty

  • url_encoding – encoding of URL or None

  • extern – None or (is_extern, is_strict)

check_connection()[source]

Check in this order: login, changing directory, list the file.

close_connection()[source]

Release the open connection from the connection pool.

cwd()[source]

Change to URL parent directory. Return filename of last path component.

get_files()[source]

Get list of filenames in directory. Subdirectories have an ending slash.

is_directory()[source]

See if URL target is a directory.

is_parseable()[source]

See if URL target is parseable for recursion.

listfile()[source]

See if filename is in the current FTP directory.

login()[source]

Log into ftp server and check the welcome message.

negotiate_encoding()[source]

Check if server can handle UTF-8 encoded filenames. See also RFC 2640.

read_content()[source]

Return URL target content, or in case of directories a dummy HTML file with links to the files.

reset()[source]

Initialize FTP url data.

set_content_type()[source]

Set URL content type, or an empty string if content type could not be found.