Skip to main content

@webda/coreReadme | API


Class: abstract BinaryFile<T>

Represent a file to store

Webda Schema

Extended by

Type parameters

T = any

Implements

Constructors

new BinaryFile(info)

new BinaryFile<T>(info): BinaryFile<T>

Parameters

info: BinaryFileInfo

Returns

BinaryFile<T>

Source

packages/core/src/services/binary.ts:118

Properties

challenge?

challenge?: string

Will be computed by the service

hash of the content prefixed by 'WEBDA'

Implementation of

BinaryFileInfo.challenge

Source

packages/core/src/services/binary.ts:106


hash?

hash?: string

Will be computed by the service

hash of the content

Implementation of

BinaryFileInfo.hash

Source

packages/core/src/services/binary.ts:112


metadata?

metadata?: T

Metadatas stored along with the binary

Implementation of

BinaryFileInfo.metadata

Source

packages/core/src/services/binary.ts:116


mimetype

mimetype: string

Mimetype of the binary

Implementation of

BinaryFileInfo.mimetype

Source

packages/core/src/services/binary.ts:100


name

name: string

Current name

Implementation of

BinaryFileInfo.name

Source

packages/core/src/services/binary.ts:88


originalname?

originalname?: string

Original name

Source

packages/core/src/services/binary.ts:92


size

size: number

Size of the binary

Implementation of

BinaryFileInfo.size

Source

packages/core/src/services/binary.ts:96

Methods

get()

abstract get(): Promise<Readable>

Returns

Promise<Readable>

Source

packages/core/src/services/binary.ts:150


getHashes()

getHashes(): Promise<Object>

Create hashes

Returns

Promise<Object>

challenge

challenge: string

hash

hash: string

Source

packages/core/src/services/binary.ts:157


set()

set(info): void

Set the information

Parameters

info: BinaryFileInfo

Returns

void

Source

packages/core/src/services/binary.ts:126


toBinaryFileInfo()

toBinaryFileInfo(): BinaryFileInfo

Retrieve a plain BinaryFileInfo object

Returns

BinaryFileInfo

Source

packages/core/src/services/binary.ts:138