Click or drag to resize

ManagerReplaceDatabase Method (String, Stream, IDictionaryString, Stream)

Note: This API is now obsolete.

Replaces or installs a database from a file.

Namespace:  Couchbase.Lite
Assembly:  Couchbase.Lite (in Couchbase.Lite.dll) Version: 1.4.1-b107
Syntax
C#
[ObsoleteAttribute("This will only work for v1 (.cblite) databases")]
public void ReplaceDatabase(
	string name,
	Stream databaseStream,
	IDictionary<string, Stream> attachmentStreams
)

Parameters

name
Type: SystemString
The name of the target Database to replace or create.
databaseStream
Type: System.IOStream
Stream on the source Database file.
attachmentStreams
Type: System.Collections.GenericIDictionaryString, Stream
Map of the associated source Attachments, or null if there are no attachments. The Map key is the name of the attachment, the map value is an InputStream for the attachment contents. If you wish to control the order that the attachments will be processed, use a LinkedHashMap, SortedMap or similar and the iteration order will be honoured.
Exceptions
ExceptionCondition
CouchbaseLiteException
Remarks
Replaces or installs a database from a file. This is primarily used to install a canned database on first launch of an app, in which case you should first check .exists to avoid replacing the database if it exists already. The canned database would have been copied into your app at build time.
See Also