ParsedVcf vcf = formatContact((Contact) item);
ParsedVcf vcf = VCard.formatContact((Contact) item);
    public void format(Context context, MailItem item) throws IOException, ServiceException {        ContentDisposition cd;        try {            cd = new ContentDisposition(Part.ATTACHMENT);        } catch (ParseException e) {            throw ServiceException.FAILURE(e.getMessage(), e);        }        if (item instanceof Contact) {            ParsedVcf vcf = formatContact((Contact) item);            cd.setParameter("filename", getZipEntryName(vcf, null));            context.resp.addHeader("Content-Disposition", cd.toString());            context.resp.setContentType("text/x-vcard");            context.resp.setCharacterEncoding("utf-8");            context.resp.getOutputStream().write(vcf.formatted.getBytes("utf-8"));            return;        }        // passed-in item is a folder or a tag or somesuch -- get the list of contacts        Iterator iterator = getMailItems(context, item, getDefaultStartTime(), getDefaultEndTime());        cd.setParameter("filename", "contacts.zip");        context.resp.addHeader("Content-Disposition", cd.toString());        context.resp.setContentType("application/x-zip-compressed");        // create the ZIP file        ZipOutputStream out = new ZipOutputStream(context.resp.getOutputStream());        HashSet<String> usedNames = new HashSet<String>();        while (iterator.hasNext()) {            MailItem itItem = (MailItem) iterator.next();            if (!(itItem instanceof Contact))                continue;            ParsedVcf vcf = formatContact((Contact) itItem);            // add ZIP entry to output stream.            out.putNextEntry(new ZipEntry(getZipEntryName(vcf, usedNames)));            out.write(vcf.formatted.getBytes("utf-8"));            out.closeEntry();        }        // complete the ZIP file        out.close();    }