Optional
customTypes: Record<string, string>Private
Readonly
baseProtected
Readonly
basePrivate
Readonly
baseProtected
Readonly
loggerPrivate
Readonly
regexProtected
Readonly
rootProtected
Readonly
unknownProtected
getProtected
getProtected
getProtected
getDetermines the content type from the document identifier.
The input identifier.
Optional
contentType: stringThe content-type provided with the request.
The content type of the document.
Protected
getProtected
getGets the relative path as though the subdomain url is the base, and then prepends it with the subdomain.
Examples assuming http://test.com/ is the base url and www
the base subdomain:
Protected
isMaps the given file path to a URL and determines its content type.
The input file path.
If the path corresponds to a file.
A ResourceLink with all the necessary metadata.
Protected
mapMaps the given container identifier to a file path, possibly making alterations to the direct translation.
The input identifier.
The direct translation of the identifier onto the file path.
A ResourceLink with all the necessary metadata.
Protected
mapMaps 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.
The input identifier.
The direct translation of the identifier onto the file path.
Optional
contentType: stringThe content-type provided with the request.
A ResourceLink with all the necessary metadata.
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.
The input identifier.
If we need the data or metadata file path.
Optional
contentType: stringThe content-type provided with the request.
A ResourceLink with all the necessary metadata.
Protected
relativeConverts a relative path to a URL.
Examples assuming http://test.com/ is the base url and www
the base subdomain:
Protected
stripProtected
validateCheck if the given relative path is valid.
BadRequestHttpError If the relative path is invalid.
A relative path, as generated by getRelativePath.
A resource identifier.
Extends the functionality of an ExtensionBasedMapper to support identifiers containing subdomains. This is mostly only relevant in case you want to support multiple pods with subdomain identifiers in a single ResourceStore.
When converting to/from file paths, the subdomain is interpreted as a folder in the rootFilePath. The rest of the path is then interpreted relative to that folder. E.g.
http://alice.test.com/foo
results in the relative path/alice/foo
.In case there is no subdomain in the URL, the
baseSubdomain
parameter is used instead. E.g., if thebaseSubdomain
is "www",http://test.com/foo
would result in the relative path/www/foo
. This means that there is no identifier that maps to therootFilePath
itself. To prevent the possibility of 2 identifiers linking to the same file, identifiers containing the default subdomain are rejected. E.g.,http://www.test.com/foo
would result in a 403, even ifhttp://test.com/foo
exists.