Options
All
  • Public
  • Public/Protected
  • All
Menu

Base class for FileIdentifierMapper implementations.

Hierarchy

Implements

Index

Constructors

Properties

baseRequestURI: string
logger: Logger = ...
rootFilepath: string

Methods

  • getAbsolutePath(path: string): string
  • getContainerUrl(relative: string): Promise<string>
  • 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.

  • getContentTypeFromPath(filePath: string): Promise<string>
  • getContentTypeFromUrl(identifier: ResourceIdentifier, contentType?: string): Promise<string>
  • getDocumentUrl(relative: string): Promise<string>
  • 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.

  • isMetadataPath(path: string): boolean
  • mapFilePathToUrl(filePath: string, isContainer: boolean): 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.

    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>

    A ResourceLink with all the necessary metadata.