Object metadataName = entry.getKey();
Object metadataValue = entry.getValue();
if (log.isDebugEnabled()) {
log.debug("Setting metadata: " + metadataName + "=" + metadataValue);
}
MetadataEntry mdEntry = new MetadataEntry();
mdEntry.setName(metadataName.toString());
mdEntry.setValue(metadataValue.toString());
metadata[index++] = mdEntry;
}
return metadata;
}