Skip to main content

FileContentStorage

@webda/utils


Class: FileContentStorage

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

Local filesystem ContentStorage implementation

Implements​

Constructors​

Constructor​

new FileContentStorage(): FileContentStorage

Returns​

FileContentStorage

Properties​

schemes​

readonly schemes: string[]

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

Schemes handled, without ':' e.g. ["s3"], ["gs", "gcs"], ["file"]

Implementation of​

ContentStorage.schemes

Methods​

deleteContent()​

deleteContent(url): Promise<void>

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

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:414

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:434

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:491

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:448

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