Options
All
  • Public
  • Public/Protected
  • All
Menu

Supports mapping a file to an URL and back.

Hierarchy

  • FileIdentifierMapper

Implemented by

Index

Properties

mapFilePathToUrl

mapFilePathToUrl: (filePath: string, isContainer: boolean) => Promise<ResourceLink>

Maps the given file path to an URL and determines the content-type

param

The input file path.

param

If the path corresponds to a file.

returns

A ResourceLink with all the necessary metadata.

Type declaration

    • (filePath: string, isContainer: boolean): Promise<ResourceLink>
    • Parameters

      • filePath: string
      • isContainer: boolean

      Returns Promise<ResourceLink>

mapUrlToFilePath

mapUrlToFilePath: (identifier: ResourceIdentifier, contentType?: string) => Promise<ResourceLink>

Maps the given resource identifier / URL to a file path. Determines the content-type if no content-type was provided by finding the corresponding file. If there is no corresponding file a file path will be generated. For containers the content-type input gets ignored.

param

The input identifier.

param

The (optional) content-type of the resource.

returns

A ResourceLink with all the necessary metadata.

Type declaration