use of com.cloudant.client.api.DesignDocumentManager in project java-cloudant by cloudant.
the class Utils method putDesignDocs.
/**
* Test utility to put design documents under the testing resource folder in to the database.
*
* @param db database to put the design docs
* @param directory location of design docs
*/
public static void putDesignDocs(Database db, File directory) throws FileNotFoundException {
// Get design documents from directory
List<DesignDocument> designDocuments = DesignDocumentManager.fromDirectory(directory);
DesignDocumentManager designDocumentManager = db.getDesignDocumentManager();
DesignDocument[] designDocArray = designDocuments.toArray(new DesignDocument[designDocuments.size()]);
// Put documents into database
designDocumentManager.put(designDocArray);
}
Aggregations