@pod-os/core / FileFetcher
Class: FileFetcher
Defined in: files/FileFetcher.ts:20
Handles HTTP operations for files, like fetching and updating file contents.
Constructors
Constructor
new FileFetcher(
session):FileFetcher
Defined in: files/FileFetcher.ts:21
Parameters
session
Returns
FileFetcher
Methods
createNewFile()
createNewFile(
container,name):ResultAsync\<NewFile,NotCreated>
Defined in: files/FileFetcher.ts:57
Parameters
container
name
string | File
Returns
ResultAsync\<NewFile, NotCreated>
createNewFolder()
createNewFolder(
container,name):ResultAsync\<NewFolder,NotCreated>
Defined in: files/FileFetcher.ts:91
Parameters
container
name
string
Returns
ResultAsync\<NewFolder, NotCreated>
fetchFile()
fetchFile(
url):Promise\<SolidFile>
Defined in: files/FileFetcher.ts:28
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:47
Updates the contents of a file (overrides old content with the given one)
Parameters
file
The file to update
newContent
string
The content to put into the file, overriding all existing
Returns
Promise\<Response>
The HTTP response