def _format_download_uri_for_extension(etextno, extension, mirror=None):
    """Returns the download location on the Project Gutenberg servers for a
    given text and extension. The list of available extensions for a given
    text can be found via the formaturi metadata extractor.

    """
    mirror = mirror or _GUTENBERG_MIRROR
    root = mirror.strip().rstrip('/')
    path = _etextno_to_uri_subdirectory(etextno)

    uri = '{root}/{path}/{etextno}{extension}'.format(
        root=root,
        path=path,
        etextno=etextno,
        extension=extension)

    return uri