Options
All
  • Public
  • Public/Protected
  • All
Menu

DataAccessor that uses the file system to store documents as files and containers as folders.

Hierarchy

  • FileDataAccessor

Implements

Index

Constructors

constructor

Properties

Private Readonly resourceMapper

resourceMapper: FileIdentifierMapper

Methods

Private addPosixMetadata

canHandle

deleteResource

Private getBaseMetadata

Private getChildMetadata

getChildren

  • Returns metadata for all resources in the requested container. This should not be all metadata of those resources (but it can be), but instead the main metadata you want to show in situations where all these resources are presented simultaneously. Generally this would be metadata that is present for all of these resources, such as resource type or last modified date.

    It can be safely assumed that the incoming identifier will always correspond to a container.

    Parameters

    Returns AsyncIterableIterator<RepresentationMetadata>

getData

Private getDirectoryMetadata

Private getFileMetadata

getMetadata

Private getRawMetadata

Private getStats

  • getStats(path: string): Promise<Stats>
  • Gets the Stats object corresponding to the given file path.

    throws

    NotFoundHttpError If the file/folder doesn't exist.

    Parameters

    • path: string

      File path to get info from.

    Returns Promise<Stats>

Private verifyExistingExtension

  • Verifies if there already is a file corresponding to the given resource. If yes, that file is removed if it does not match the path given in the input ResourceLink. This can happen if the content-type differs from the one that was stored.

    Parameters

    • link: ResourceLink

      ResourceLink corresponding to the new resource data.

    Returns Promise<void>

writeContainer

Private writeDataFile

  • writeDataFile(path: string, data: Readable): Promise<void>
  • Helper function without extra validation checking to create a data file.

    Parameters

    • path: string

      The filepath of the file to be created.

    • data: Readable

      The data to be put in the file.

    Returns Promise<void>

writeDocument

Private writeMetadata