Options
All
  • Public
  • Public/Protected
  • All
Menu

Supports the behaviour described in https://www.w3.org/DesignIssues/HTTPFilenameMapping.html Determines content-type based on the file extension. In case an identifier does not end on an extension matching its content-type, the corresponding file will be appended with the correct extension, preceded by $.

Hierarchy

Index

Constructors

  • new ExtensionBasedMapper(base: string, rootFilepath: string, customTypes?: Record<string, string>): ExtensionBasedMapper

Properties

baseRequestURI: string
customExtensions: Record<string, string>
customTypes: Record<string, string>
logger: Logger = ...
rootFilepath: string

Methods

  • getAbsolutePath(path: string): string
  • getContainerUrl(relative: string): Promise<string>
  • getContentTypeFromPath(filePath: string): Promise<string>
  • getContentTypeFromUrl(identifier: ResourceIdentifier, contentType?: string): Promise<string>
  • getDocumentUrl(relative: string): Promise<string>
  • isMetadataPath(path: string): boolean
  • mapFilePathToUrl(filePath: string, isContainer: boolean): Promise<ResourceLink>
  • stripExtension(path: string): string
  • Helper function that removes the internal extension, one starting with $., from the given path. Nothing happens if no such extension is present.

    Parameters

    • path: string

    Returns string