Example usage for com.mongodb.gridfs GridFS getFileList

List of usage examples for com.mongodb.gridfs GridFS getFileList

Introduction

In this page you can find the example usage for com.mongodb.gridfs GridFS getFileList.

Prototype

public DBCursor getFileList() 

Source Link

Document

Gets the list of files stored in this gridfs, sorted by filename.

Usage

From source file:se.inera.axel.shs.broker.messagestore.internal.MongoMessageStoreServiceIT.java

License:Open Source License

@Test(groups = "largeTests", enabled = true)
public void deletingNonExistingFileShouldBeANoOp() {
    messageStore.delete(make(a(ShsMessageEntryMaker.ShsMessageEntry)));

    mongoOperations.execute(new DbCallback<Object>() {
        @Override//from ww w  .j av  a 2 s .  c o  m
        public Object doInDB(DB db) throws MongoException, DataAccessException {
            GridFS gridFs = new GridFS(db);
            DBCursor dbCursor = gridFs.getFileList();

            assertThat(dbCursor.count(), is(0));

            return null;
        }
    });
}