public class DocumentLoader extends Object
cbdocloader tool.| Constructor and Description |
|---|
DocumentLoader(CouchbaseMock mock,
String bucketName)
Create a new document loader
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleDesign(String designName,
String contents) |
protected void |
handleDocument(String docId,
String contents) |
static void |
loadBeerSample(CouchbaseMock mock)
Load the
`beer-sample` bucket |
void |
loadDocuments(String docsFile)
Load documents into the bucket
|
static void |
loadFromSerializedXZ(InputStream is,
String bucketName,
CouchbaseMock mock)
Loads the
beer-sample documents from the built-in serialized compressed resource. |
static void |
main(String[] args)
Converts a zip file into a serialized compress resource.
|
public DocumentLoader(CouchbaseMock mock, String bucketName)
mock - The clusterbucketName - The name of the bucket in which the documents should be loaded. The bucket must existprotected void handleDesign(String designName, String contents) throws IOException
IOExceptionpublic void loadDocuments(String docsFile) throws IOException
docsFile - The path to the ZIP file which contains the documentsIOException - if an I/O error occurspublic static void loadFromSerializedXZ(InputStream is, String bucketName, CouchbaseMock mock) throws IOException
beer-sample documents from the built-in serialized compressed resource.is - The input streambucketName - The target bucket into which the docs should be loadedmock - The clusterIOException - if an I/O error occurspublic static void loadBeerSample(CouchbaseMock mock) throws IOException
`beer-sample` bucketmock - The clusterIOException - if an I/O error occursCopyright © 2017. All rights reserved.