throws MetadataValidationException,
CrosswalkException, IOException, SQLException, AuthorizeException
{
Element file = getElementByXPath("descendant::mets:file[@ID=\""+fileId+"\"]", false);
if (file == null)
throw new MetadataValidationException("Failed in Bitstream crosswalk, Could not find file element with ID="+fileId);
// In DSpace METS SIP spec, admin metadata is only "highly
// recommended", not "required", so it is OK if there is no ADMID.
String amds = file.getAttributeValue("ADMID");
if (amds == null)
{
log.warn("Got no bitstream ADMID, file@ID="+fileId);
return;
}
String amdID[] = amds.split("\\s+");
for (int i = 0; i < amdID.length; ++i)
{
List techMDs = getElementByXPath("mets:amdSec[@ID=\""+amdID[i]+"\"]", false).
getChildren("techMD", metsNS);
Iterator ti = techMDs.iterator();
while (ti.hasNext())
{
Element techMD = (Element)ti.next();
if (techMD != null)
{
String type = getMdType(techMD);
IngestionCrosswalk xwalk = getCrosswalk(type);
log.debug("Got bitstream techMD of type="+type+", for file ID="+fileId);
if (xwalk == null)
throw new MetadataValidationException("Cannot process METS Manifest: "+
"No crosswalk found for techMD MDTYPE="+type);
crosswalkMdContent(techMD, callback, xwalk, context, bitstream);
}
}
}