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

canHandle

deleteResource

Private generatePosixQuads

  • generatePosixQuads(subject: NamedNode<string>, stats: Stats): Quad[]
  • Helper function to add file system related metadata.

    Parameters

    • subject: NamedNode<string>

      Subject for the new quads.

    • stats: Stats

      Stats of the file/directory corresponding to the resource.

    Returns Quad[]

Private getBaseMetadata

Private getChildMetadataQuads

  • getChildMetadataQuads(link: ResourceLink): Promise<Quad[]>
  • Generate all containment related triples for a container. These include the actual containment triples and specific triples for every child resource.

    Parameters

    Returns Promise<Quad[]>

getData

Private getDirectoryMetadata

Private getFileMetadata

getMetadata

Private getMetadataLink

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 isMetadataPath

  • isMetadataPath(path: string): boolean

Private verifyExistingExtension

  • verifyExistingExtension(link: ResourceLink): Promise<void>
  • 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