Package com.emc.esu.api

Examples of com.emc.esu.api.ServiceInformation


        // 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());
                  }
                }
               
              }
            }
View Full Code Here


        // 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());
                  }
                }
               
              }
            }
View Full Code Here

        return newObjectInfo;
    }

    private ServiceInformation adaptServiceInformation( com.emc.atmos.api.bean.ServiceInformation serviceInformation ) {
        if ( serviceInformation == null ) return null;
        ServiceInformation newServiceInformation = new ServiceInformation();
        newServiceInformation.setAtmosVersion( serviceInformation.getAtmosVersion() );
        newServiceInformation.setUnicodeMetadataSupported( serviceInformation.hasFeature( com.emc.atmos.api.bean.ServiceInformation.Feature.Utf8 ) );
        for ( com.emc.atmos.api.bean.ServiceInformation.Feature feature : serviceInformation.getFeatures() ) {
            newServiceInformation.addFeature( feature.getHeaderName() );
        }
        return newServiceInformation;
    }
View Full Code Here

TOP

Related Classes of com.emc.esu.api.ServiceInformation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.