Base class for FileIdentifierMapper implementations.

Hierarchy (view full)

Implements

Constructors

Properties

baseRequestURI: string
logger: Logger = ...
rootFilepath: string
unknownMediaTypeExtension: "unknown" = 'unknown'

Methods

  • Maps the given container path to a URL and determines its content type.

    Parameters

    • relative: string

      The relative container path.

    Returns Promise<string>

    A ResourceLink with all the necessary metadata.

  • Determines the content type from the relative path.

    Parameters

    • filePath: string

      The file path of the document.

    Returns Promise<string>

    The content type of the document.

  • Determines the content type from the document identifier.

    Parameters

    • identifier: ResourceIdentifier

      The input identifier.

    • OptionalcontentType: string

      The content-type provided with the request.

    Returns Promise<string>

    The content type of the document.

  • Maps the given document path to a URL and determines its content type.

    Parameters

    • relative: string

      The relative document path.

    Returns Promise<string>

    A ResourceLink with all the necessary metadata.

  • Maps the given document identifier to a file path, possibly making alterations to the direct translation (for instance, based on its content type)). Determines the content type if none was provided.

    Parameters

    • identifier: ResourceIdentifier

      The input identifier.

    • filePath: string

      The direct translation of the identifier onto the file path.

    • OptionalcontentType: string

      The content-type provided with the request.

    Returns Promise<ResourceLink>

    A ResourceLink with all the necessary metadata.