Class SysDocumentApi
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime.dll
public class SysDocumentApi : ISysDocumentApi, IDslApi
Inheritance
Implements
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
The document object.
OpenRead(string)
Open a document for reading.
public Stream OpenRead(string name)
Parameters
name string
The document name.
Returns
A read-only stream.
OpenWrite(string)
Open a document for reading.
public Stream OpenWrite(string name)
Parameters
name string
The document name.
Returns
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.