code: public List<GridFSDBFile> find(final DBObject query, final DBObject sort, final int firstResult,
              final int maxResult)
      {
          List<GridFSDBFile> files = new ArrayList<GridFSDBFile>();
  
          DBCursor c = null;
          try
          {
              c = getFilesCollection().find(query);
              if (sort != null)
              {
                  c.sort(sort);
              }
              c.skip(firstResult).limit(maxResult);
              while (c.hasNext())
              {
                  files.add(findOne(c.next()));
              }
          }
          finally
          {
              if (c != null)
              {
                  c.close();
              }
          }
          return files;
      }
docs: Finds a list of files matching the given query.
  
  @param query
  the filter to apply
  @param sort
  the fields to sort with
  @param firstResult
  number of files to skip
  @param maxResult
  number of files to return
  @return list of gridfs files