fix: Remove metadata content-type assumption from FileDataAccessor

This commit is contained in:
Joachim Van Herwegen 2020-12-15 14:44:02 +01:00
parent d7434df808
commit 1464288b0f

View File

@ -7,7 +7,6 @@ import type { NamedNode, Quad } from 'rdf-js';
import type { Representation } from '../../ldp/representation/Representation'; import type { Representation } from '../../ldp/representation/Representation';
import { RepresentationMetadata } from '../../ldp/representation/RepresentationMetadata'; import { RepresentationMetadata } from '../../ldp/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../ldp/representation/ResourceIdentifier'; import type { ResourceIdentifier } from '../../ldp/representation/ResourceIdentifier';
import { TEXT_TURTLE } from '../../util/ContentTypes';
import { ConflictHttpError } from '../../util/errors/ConflictHttpError'; import { ConflictHttpError } from '../../util/errors/ConflictHttpError';
import { NotFoundHttpError } from '../../util/errors/NotFoundHttpError'; import { NotFoundHttpError } from '../../util/errors/NotFoundHttpError';
import { isSystemError } from '../../util/errors/SystemError'; import { isSystemError } from '../../util/errors/SystemError';
@ -166,7 +165,7 @@ export class FileDataAccessor implements DataAccessor {
* Starts from the identifier to make sure any potentially added extension has no impact on the path. * Starts from the identifier to make sure any potentially added extension has no impact on the path.
*/ */
private async getMetadataPath(identifier: ResourceIdentifier): Promise<string> { private async getMetadataPath(identifier: ResourceIdentifier): Promise<string> {
return (await this.resourceMapper.mapUrlToFilePath({ path: `${identifier.path}.meta` }, TEXT_TURTLE)).filePath; return (await this.resourceMapper.mapUrlToFilePath({ path: `${identifier.path}.meta` })).filePath;
} }
/** /**