mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Added resourceExists method to ResourceStore
* feat: added resourceExists method to ResourceStore * Merge remote-tracking branch 'origin/main' into feat/add-resourceExists-method-to-ResourceStore * fix: adapted to review * fix: adapted to review
This commit is contained in:
committed by
GitHub
parent
e5b7d99da4
commit
b3f292d718
@@ -4,7 +4,6 @@ import { BasicRepresentation } from '../ldp/representation/BasicRepresentation';
|
||||
import type { ResourceIdentifier } from '../ldp/representation/ResourceIdentifier';
|
||||
import { getLoggerFor } from '../logging/LogUtil';
|
||||
import type { ResourceStore } from '../storage/ResourceStore';
|
||||
import { containsResource } from '../storage/StoreUtil';
|
||||
import { TEXT_TURTLE } from '../util/ContentTypes';
|
||||
import { ensureTrailingSlash, joinFilePath } from '../util/PathUtil';
|
||||
import { Initializer } from './Initializer';
|
||||
@@ -39,7 +38,7 @@ export class AclInitializer extends Initializer {
|
||||
// https://solid.github.io/specification/protocol#storage
|
||||
public async handle(): Promise<void> {
|
||||
const rootAcl = this.aclStrategy.getAuxiliaryIdentifier(this.root);
|
||||
if (await containsResource(this.store, rootAcl)) {
|
||||
if (await this.store.resourceExists(rootAcl)) {
|
||||
this.logger.debug(`Existing root ACL document found at ${rootAcl.path}`);
|
||||
} else {
|
||||
this.logger.debug(`Installing root ACL document at ${rootAcl.path}`);
|
||||
|
||||
@@ -4,7 +4,6 @@ import { RepresentationMetadata } from '../ldp/representation/RepresentationMeta
|
||||
import type { ResourceIdentifier } from '../ldp/representation/ResourceIdentifier';
|
||||
import { getLoggerFor } from '../logging/LogUtil';
|
||||
import type { ResourceStore } from '../storage/ResourceStore';
|
||||
import { containsResource } from '../storage/StoreUtil';
|
||||
import { TEXT_TURTLE } from '../util/ContentTypes';
|
||||
import { ensureTrailingSlash } from '../util/PathUtil';
|
||||
import { generateResourceQuads } from '../util/ResourceUtil';
|
||||
@@ -32,7 +31,7 @@ export class RootContainerInitializer extends Initializer {
|
||||
|
||||
public async handle(): Promise<void> {
|
||||
this.logger.debug(`Checking for root container at ${this.baseId.path}`);
|
||||
if (!await containsResource(this.store, this.baseId)) {
|
||||
if (!await this.store.resourceExists(this.baseId)) {
|
||||
await this.createRootContainer();
|
||||
} else {
|
||||
this.logger.debug(`Existing root container found at ${this.baseId.path}`);
|
||||
|
||||
Reference in New Issue
Block a user