Collection appts = mailbox.getAppointmentsForRange(octxt, start, end, Mailbox.ID_FOLDER_CALENDAR);
Collection appts = mailbox.getAppointmentsForRange(octxt, start, end, Mailbox.ID_FOLDER_CALENDAR, null);
    private void doRss(HttpServletRequest req, HttpServletResponse resp, Account acct, Mailbox mailbox, long start, long end)    throws ServiceException, IOException    {        resp.setContentType("application/rss+xml");                    StringBuffer sb = new StringBuffer();        sb.append("<?xml version=\"1.0\"?>");                    Element.XMLElement rss = new Element.XMLElement("rss");        rss.addAttribute("version", "2.0");        Element channel = rss.addElement("channel");        channel.addElement("title").setText("Zimbra Mail: " + acct.getName());                    channel.addElement("generator").setText("Zimbra RSS Feed Servlet");        OperationContext octxt = new OperationContext(acct);                    Collection appts = mailbox.getAppointmentsForRange(octxt, start, end, Mailbox.ID_FOLDER_CALENDAR);                        //channel.addElement("description").setText(query);        SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");//        MailDateFormat mdf = new MailDateFormat();        for (Iterator apptIt = appts.iterator(); apptIt.hasNext(); ) {                        Appointment appt = (Appointment) apptIt.next();            Collection instances = appt.expandInstances(start, end);            for (Iterator instIt = instances.iterator(); instIt.hasNext(); ) {                Appointment.Instance inst = (Appointment.Instance) instIt.next();                InviteInfo invId = inst.getInviteInfo();                Invite inv = appt.getInvite(invId.getMsgId(), invId.getComponentId());                Element item = channel.addElement("item");                item.addElement("title").setText(inv.getName());                item.addElement("pubDate").setText(sdf.format(new Date(inst.getStart())));                /*                                StringBuffer desc = new StringBuffer();                sb.append("Start: ").append(sdf.format(new Date(inst.getStart()))).append("\n");                sb.append("End: ").append(sdf.format(new Date(inst.getEnd()))).append("\n");                sb.append("Location: ").append(inv.getLocation()).append("\n");                sb.append("Notes: ").append(inv.getFragment()).append("\n");                item.addElement("description").setText(sb.toString());                */                item.addElement("description").setText(inv.getFragment());                item.addElement("author").setText(CalendarUtils.paramVal(inv.getOrganizer(), Parameter.CN));                /* TODO: guid, links, etc */                //Element guid = item.addElement("guid");                //guid.setText(appt.getUid()+"-"+inv.getStartTime().getUtcTime());                //guid.addAttribute("isPermaLink", "false");            }                            }        sb.append(rss.toString());        resp.getOutputStream().write(sb.toString().getBytes());    }