// Use JDOM to parse the XML
SAXBuilder sb = new SAXBuilder();
try {
Document d = sb.build( new ByteArrayInputStream( response ) );
ServiceInformation si = new ServiceInformation();
// The ObjectID element is part of a namespace so we need to use
// the namespace to identify the elements.
Namespace esuNs = Namespace.getNamespace( "http://www.emc.com/cos/" );
Element ver = d.getRootElement().getChild( "Version", esuNs );
Element atmos = ver.getChild( "Atmos", esuNs );
si.setAtmosVersion( atmos.getTextNormalize() );
// Check for UTF8 support
for(String key : map.keySet()) {
if("x-emc-support-utf8".equalsIgnoreCase(key)) {
for(String val : map.get(key)) {
if("true".equalsIgnoreCase(val)) {
si.setUnicodeMetadataSupported(true);
}
}
}
if("x-emc-features".equalsIgnoreCase(key)) {
for(String val : map.get(key)) {
String[] features = val.split(",");
for(String feature : features) {
si.addFeature(feature.trim());
}
}
}
}