Table of Contents

Class SysDocumentApi

Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime.dll

public class SysDocumentApi : ISysDocumentApi, IDslApi

Inheritance

objectSysDocumentApi

Implements

ISysDocumentApi, IDslApi

Inherited Members

object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Extension Methods

ObjectExtension.ConvertToBsonValue(object), EnumExtensions.DeepClone<SysDocumentApi>(SysDocumentApi)

Constructors

SysDocumentApi(IFileStorage, IDocumentRepository)

public SysDocumentApi(IFileStorage fileStorage, IDocumentRepository documentRepository)

Parameters

fileStorage IFileStorage

documentRepository IDocumentRepository

Methods

Load(string)

Load the document object by name.

public SystemDocument Load(string name)

Parameters

name string

The document name.

Returns

SystemDocument

The document object.

OpenRead(string)

Open a document for reading.

public Stream OpenRead(string name)

Parameters

name string

The document name.

Returns

Stream

A read-only stream.

OpenWrite(string)

Open a document for reading.

public Stream OpenWrite(string name)

Parameters

name string

The document name.

Returns

Stream

A writable stream.

ReadAllBytes(string)

Reads the contents of the file into a byte array.

public byte[] ReadAllBytes(string name)

Parameters

name string

The document name.

Returns

byte[]

The byte array.

ReadToStream(string, Stream)

Reads the contents of a blob to a stream.

public void ReadToStream(string name, Stream stream)

Parameters

name string

The document name.

stream Stream

A readable stream

Store(string, Stream)

Stores document with a stream. If the document already exists, it will be overwritten.

public void Store(string name, Stream stream)

Parameters

name string

The system document name.

stream Stream

The stream.