Skip to content

@pod-os/core


@pod-os/core / FileFetcher

Class: FileFetcher

Defined in: files/FileFetcher.ts:7

Constructors

Constructor

new FileFetcher(session): FileFetcher

Defined in: files/FileFetcher.ts:8

Parameters

session

PodOsSession

Returns

FileFetcher

Methods

fetchFile()

fetchFile(url): Promise\<SolidFile>

Defined in: files/FileFetcher.ts:15

Fetch the contents of the given file

Parameters

url

string

URL identifying the file

Returns

Promise\<SolidFile>

An object representing the fetched file


putFile()

putFile(file, newContent): Promise\<Response>

Defined in: files/FileFetcher.ts:34

Updates the contents of a file (overrides old content with the given one)

Parameters

file

SolidFile

The file to update

newContent

string

The content to put into the file, overriding all existing

Returns

Promise\<Response>

The HTTP response