BinaryDataStorageManager
Namespace: TagBites.IO.Storages
Assembly: TagBites.IO.dll
Product: TagBites.IO v. 2.0.0
Provides a manager functionality for IBinaryDataStorage objects.
public class BinaryDataStorageManagerInheritance: object → BinaryDataStorageManager
Constructors
Section titled “Constructors”BinaryDataStorageManager()
Section titled “BinaryDataStorageManager()”public BinaryDataStorageManager()Properties
Section titled “Properties”Storages
Section titled “Storages”Gets the list of registered storages.
public IList<BinaryDataStorageInfo> Storages { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Delete(IFileResourceLink)
Section titled “Delete(IFileResourceLink)”Deletes the data from storage related to resource content path.
public bool Delete(IFileResourceLink resource)Parameters
Section titled “Parameters”resourceIFileResourceLink
The resource.
Returns
Section titled “Returns”Delete(string)
Section titled “Delete(string)”Deletes the data from storage related to content path.
public bool Delete(string contentPath)Parameters
Section titled “Parameters”contentPathstring
The content path.
Returns
Section titled “Returns”GetCurrentStorage(IFileResourceLink)
Section titled “GetCurrentStorage(IFileResourceLink)”Gets a current storage for the specified resource.
public BinaryDataStorageInfo GetCurrentStorage(IFileResourceLink resource)Parameters
Section titled “Parameters”resourceIFileResourceLink
The resource.
Returns
Section titled “Returns”A BinaryDataStorageInfo representing the preferred storage.
GetPreferredStorage(IFileResourceLink)
Section titled “GetPreferredStorage(IFileResourceLink)”Gets a preferred storage for the specified resource.
public virtual BinaryDataStorageInfo GetPreferredStorage(IFileResourceLink resource)Parameters
Section titled “Parameters”resourceIFileResourceLink
The resource.
Returns
Section titled “Returns”A BinaryDataStorageInfo representing the preferred storage.
Read(IFileResourceLink)
Section titled “Read(IFileResourceLink)”Reads the data from storage related to resource content path.
public Stream Read(IFileResourceLink resource)Parameters
Section titled “Parameters”resourceIFileResourceLink
The resource.
Returns
Section titled “Returns”A Stream object representing a read-only stream for the specified resource or
null.
Read(string)
Section titled “Read(string)”Reads the data from storage related to resource content path.
public Stream Read(string contentPath)Parameters
Section titled “Parameters”contentPathstring
The content path.
Returns
Section titled “Returns”A Stream object representing a read-only stream for the specified contentPath or
null.
RegisterStorage(string, IBinaryDataStorage)
Section titled “RegisterStorage(string, IBinaryDataStorage)”Registers the specified binary data storage for defined prefix.
public void RegisterStorage(string prefix, IBinaryDataStorage storage)Parameters
Section titled “Parameters”prefixstring
The prefix for the .storageIBinaryDataStorage
A IBinaryDataStorage object providing read, write and delete operations.
Write(IFileResourceLink, Stream)
Section titled “Write(IFileResourceLink, Stream)”Writes the data to preferred storage.
public string Write(IFileResourceLink resource, Stream data)Parameters
Section titled “Parameters”resourceIFileResourceLink
The resource.dataStream
The stream from which the content is written.
Returns
Section titled “Returns”A String representing a content path to written data.