driver-legacy/src/main/com/mongodb/gridfs/GridFS.java
public void remove(final DBObject query) {
        if (query == null) {
            throw new IllegalArgumentException("query can not be null");
        }

        for (final GridFSDBFile f : find(query)) {
            f.remove();
        }
    }
public void remove(final DBObject query) {
        if (query == null) {
            throw new IllegalArgumentException("query can not be null");
        }

        for (final GridFSDBFile f : find(query)) {
            f.remove();
        }
    }
Removes all files matching the given query.

@param query filter to apply
@throws com.mongodb.MongoException if the operation fails