Base class for FileIdentifierMapper implementations.

Hierarchy

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.

    Returns

    A ResourceLink with all the necessary metadata.

    Parameters

    • relative: string

      The relative container path.

    Returns Promise<string>

  • Determines the content type from the relative path.

    Returns

    The content type of the document.

    Parameters

    • filePath: string

      The file path of the document.

    Returns Promise<string>

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

    Returns

    A ResourceLink with all the necessary metadata.

    Parameters

    • relative: string

      The relative document path.

    Returns Promise<string>

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

    Returns

    A ResourceLink with all the necessary metadata.

    Parameters

    • filePath: string

      The input file path.

    • isContainer: boolean

      If the path corresponds to a file.

    Returns Promise<ResourceLink>

  • 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.

    Returns

    A ResourceLink with all the necessary metadata.

    Parameters

    • identifier: ResourceIdentifier

      The input identifier.

    • filePath: string

      The direct translation of the identifier onto the file path.

    • Optional contentType: string

      The content-type provided with the request.

    Returns Promise<ResourceLink>

  • Maps the given resource identifier / URL to a file path. Determines the content type if none was provided. For containers the content-type input is ignored.

    Returns

    A ResourceLink with all the necessary metadata.

    Parameters

    • identifier: ResourceIdentifier

      The input identifier.

    • isMetadata: boolean

      If we need the data or metadata file path.

    • Optional contentType: string

      The content-type provided with the request.

    Returns Promise<ResourceLink>