Options
All
  • Public
  • Public/Protected
  • All
Menu

Initializer that sets up the root container. Will copy all the files and folders in the given path to the corresponding documents and containers. This will always happen when the server starts unless the following 2 conditions are both fulfilled:

  • The container already exists.
  • The container has metadata indicating it is a pim:Storage.

It is important that the ResourcesGenerator generates a <> a pim:Storage triple for the root container: this prevents deletion of the root container as storage root containers can not be deleted. Solid, §4.1: "Servers exposing the storage resource MUST advertise by including the HTTP Link header with rel="type" targeting http://www.w3.org/ns/pim/space#Storage when responding to storage’s request URI." https://solid.github.io/specification/protocol#storage

Hierarchy

Index

Constructors

constructor

Properties

Private Readonly baseId

Private Readonly generator

Protected Readonly logger

logger: Logger = ...

Private Readonly store

Methods

canHandle

  • canHandle(input: void): Promise<void>
  • Checks if the input data can be handled by this class. Throws an error if it can't handle the data.

    Parameters

    • input: void

      Input data that could potentially be handled.

    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not.

handle

  • handle(): Promise<void>
  • Handles the given input. This should only be done if the canHandle function returned true. Therefore, consider using the handleSafe function instead.

    Returns Promise<void>

    A promise resolving when the handling is finished. Return value depends on the given type.

handleSafe

  • handleSafe(input: void): Promise<void>
  • Helper function that first runs the canHandle function followed by the handle function. Throws the error of the canHandle function if the data can't be handled, or returns the result of the handle function otherwise.

    Parameters

    • input: void

      Input data that will be handled if it can be handled.

    Returns Promise<void>

    A promise resolving if the input can be handled, rejecting with an Error if not. Return value depends on the given type.

Private rootContainerIsValid

  • rootContainerIsValid(): Promise<boolean>