ze.setSize(bitstreams[k].getSize());
ze.setTime(lmTime); ze.setSize(auth ? bitstreams[k].getSize() : 0);
    public void disseminate(Context context, DSpaceObject dso,                            PackageParameters params, OutputStream pkg)        throws PackageValidationException, CrosswalkException, AuthorizeException, SQLException, IOException    {        if (dso.getType() == Constants.ITEM)        {            Item item = (Item)dso;            if (params != null && params.getProperty("manifestOnly") != null)            {                extraFiles = null;                writeManifest(context, item, params, pkg);            }            else            {                extraFiles = new HashMap();                ZipOutputStream zip = new ZipOutputStream(pkg);                zip.setComment("METS archive created by DSpace MetsDissemination");                // write manifest first.                ZipEntry me = new ZipEntry(MANIFEST_FILE);                zip.putNextEntry(me);                writeManifest(context, item, params, zip);                zip.closeEntry();                                // copy extra (meta?) bitstreams into zip                Iterator fi = extraFiles.keySet().iterator();                while (fi.hasNext())                {                    String fname = (String)fi.next();                    ZipEntry ze = new ZipEntry(fname);                    zip.putNextEntry(ze);                    Utils.copy((InputStream)extraFiles.get(fname), zip);                    zip.closeEntry();                }                // copy all non-meta bitstreams into zip                Bundle bundles[] = item.getBundles();                for (int i = 0; i < bundles.length; i++)                {                    if (!PackageUtils.isMetaInfoBundle(bundles[i]))                    {                        Bitstream[] bitstreams = bundles[i].getBitstreams();                        for (int k = 0; k < bitstreams.length; k++)                        {                            if (AuthorizeManager.authorizeActionBoolean(context,                                    bitstreams[k], Constants.READ))                            {                                ZipEntry ze = new ZipEntry(                                    makeBitstreamName(bitstreams[k]));                                ze.setSize(bitstreams[k].getSize());                                zip.putNextEntry(ze);                                Utils.copy(bitstreams[k].retrieve(), zip);                                zip.closeEntry();                            }                        }                    }                }                zip.close();                extraFiles = null;            }        }        else            throw new PackageValidationException("Can only disseminate an Item now.");    }