{
if (unauth != null &&
(unauth.equalsIgnoreCase("skip")))
continue;
else
throw new AuthorizeException("Not authorized to read Bundle named \""+bundles[i].getName()+"\"");
}
Bitstream[] bitstreams = bundles[i].getBitstreams();
// Create a fileGrp
FileGrp fileGrp = new FileGrp();
// Bundle name for USE attribute
String bName = bundles[i].getName();
if ((bName != null) && !bName.equals(""))
fileGrp.setUSE(bundleToFileGrp(bName));
// watch for primary bitstream
int primaryBitstreamID = -1;
boolean isContentBundle = false;
if ((bName != null) && bName.equals("ORIGINAL"))
{
isContentBundle = true;
primaryBitstreamID = bundles[i].getPrimaryBitstreamID();
}
for (int bits = 0; bits < bitstreams.length; bits++)
{
// Check for authorization. Handle unauthorized
// bitstreams to match the logic in disseminate(),
// i.e. "unauth=zero" means include a 0-length bitstream,
// "unauth=skip" means to ignore it (and exclude from
// manifest).
boolean auth = AuthorizeManager.authorizeActionBoolean(context,
bitstreams[bits], Constants.READ);
if (!auth)
{
if (unauth != null && unauth.equalsIgnoreCase("skip"))
continue;
else if (!(unauth != null && unauth.equalsIgnoreCase("zero")))
throw new AuthorizeException("Not authorized to read Bitstream, SID="+String.valueOf(bitstreams[bits].getSequenceID()));
}
String sid = String.valueOf(bitstreams[bits].getSequenceID());
edu.harvard.hul.ois.mets.File file = new edu.harvard.hul.ois.mets.File();