Options
All
  • Public
  • Public/Protected
  • All
Menu

Base class for FileIdentifierMapper implementations.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected Readonly baseRequestURI

baseRequestURI: string

Protected Readonly logger

logger: Logger = ...

Protected Readonly rootFilepath

rootFilepath: string

Methods

Protected getAbsolutePath

  • getAbsolutePath(path: string): string

Protected getContainerUrl

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

Protected getContentTypeFromPath

  • getContentTypeFromPath(filePath: string): Promise<string>

Protected getContentTypeFromUrl

  • getContentTypeFromUrl(identifier: ResourceIdentifier, contentType?: string): Promise<string>

Protected getDocumentUrl

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

Protected getRelativePath

mapFilePathToUrl

  • mapFilePathToUrl(filePath: string, isContainer: boolean): Promise<ResourceLink>
  • Maps the given file path to a URL and determines its content type.

    Parameters

    • filePath: string

      The input file path.

    • isContainer: boolean

      If the path corresponds to a file.

    Returns Promise<ResourceLink>

    A ResourceLink with all the necessary metadata.

Protected mapUrlToContainerPath

Protected mapUrlToDocumentPath

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

mapUrlToFilePath

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

    Parameters

    • identifier: ResourceIdentifier

      The input identifier.

    • Optional contentType: string

      The content-type provided with the request.

    Returns Promise<ResourceLink>

    A ResourceLink with all the necessary metadata.

Protected validateRelativePath