Skip to main content

FileContentStorage

@webda/utils


Class: FileContentStorage

Defined in: packages/utils/src/content.ts:481

Local filesystem ContentStorage implementation

Implements​

Constructors​

Constructor​

new FileContentStorage(): FileContentStorage

Returns​

FileContentStorage

Properties​

schemes​

readonly schemes: string[]

Defined in: packages/utils/src/content.ts:485

Schemes

Implementation of​

ContentStorage.schemes

Methods​

deleteContent()​

deleteContent(url): Promise<void>

Defined in: packages/utils/src/content.ts:589

Delete file

Parameters​

url​

string

file URL or path

Returns​

Promise<void>

Implementation of​

ContentStorage.deleteContent


getContent()​

getContent(url, options?): Promise<Readable>

Defined in: packages/utils/src/content.ts:493

Get content read stream

Parameters​

url​

string

file URL or path

options?​

ContentGetOptions

range options

Returns​

Promise<Readable>

Readable stream

Implementation of​

ContentStorage.getContent


getWriteStream()​

getWriteStream(url): Promise<Writable>

Defined in: packages/utils/src/content.ts:513

Get a write stream to the target path, creating parent directories if needed

Parameters​

url​

string

file URL or path

Returns​

Promise<Writable>

Writable stream


headContent()​

headContent(url): Promise<ContentInfo | undefined>

Defined in: packages/utils/src/content.ts:570

Head content metadata

Parameters​

url​

string

file URL or path

Returns​

Promise<ContentInfo | undefined>

ContentInfo or undefined if not found

Implementation of​

ContentStorage.headContent


putContent()​

putContent(url, body, options?): Promise<ContentInfo>

Defined in: packages/utils/src/content.ts:527

Put content atomically via temporary file and rename

Parameters​

url​

string

file URL or path

body​

ContentBody

content to write

options?​

ContentPutOptions

write options

Returns​

Promise<ContentInfo>

written ContentInfo

Implementation of​

ContentStorage.putContent