// if we keep the original, then expose this as the content element
// otherwise, expose the unpacked version
if (keepOriginal)
{
Content con = new Content();
Bundle[] bundles = item.getBundles(swordBundle);
if (bundles.length > 0)
{
Bitstream[] bss = bundles[0].getBitstreams();
for (int i = 0; i < bss.length; i++)
{
BitstreamFormat bf = bss[i].getFormat();
String format = "application/octet-stream";
if (bf != null)
{
format = bf.getMIMEType();
}
con.setType(format);
// calculate the bitstream link.
String bsLink = urlManager.getBitstreamUrl(bss[i]);
con.setSource(bsLink);
entry.setContent(con);
}
}
}
else
{
// return a link to the DSpace entry page
Content content = new Content();
content.setType("text/html");
content.setSource(HandleManager.getCanonicalForm(handle));
entry.setContent(content);
}
}
}
}