if (bunds[0] != null) {
Bitstream[] bits = bunds[0].getBitstreams();
for (int i = 0; (i < bits.length); i++) {
String mime = bits[i].getFormat().getMIMEType();
if(podcastableMIMETypes.contains(mime)) {
SyndEnclosure enc = new SyndEnclosureImpl();
enc.setType(bits[i].getFormat().getMIMEType());
enc.setLength(bits[i].getSize());
enc.setUrl(urlOfBitstream(request, bits[i]));
enclosures.add(enc);
} else {
continue;
}
}
}
//Also try to add an external value from dc.identifier.other
// We are assuming that if this is set, then it is a media file
Metadatum[] externalMedia = item.getMetadataByMetadataString(externalSourceField);
if(externalMedia.length > 0)
{
for(int i = 0; i< externalMedia.length; i++)
{
SyndEnclosure enc = new SyndEnclosureImpl();
enc.setType("audio/x-mpeg"); //We can't determine MIME of external file, so just picking one.
enc.setLength(1);
enc.setUrl(externalMedia[i].value);
enclosures.add(enc);
}
}
} catch (Exception e) {