while (metadataIter.hasNext()) {
Map.Entry entry = (Map.Entry) metadataIter.next();
Object metadataName = entry.getKey();
Object metadataValue = entry.getValue();
log.debug("Setting metadata: " + metadataName + "=" + metadataValue);
MetadataEntry mdEntry = new MetadataEntry();
mdEntry.setName(metadataName.toString());
mdEntry.setValue(metadataValue.toString());
metadata[index++] = mdEntry;
}
return metadata;
}