This method finds the configuration location, returns null if don't finds it
@param cc configuration chosen
@param xml xml object
@return configuration found
187587
protected ChooseConfig searchConfig(ChooseConfig cc, XML xml){
    	
    	ChooseConfig      config = searchXmlConfig(cc, xml);
    	if(isNull(config))config = searchAnnotatedConfig(cc);
    	return config;
    }
446950
public void addCc(String cc) {
        if (this.cc.length() > 0) {
            this.cc.append(",");
        }
        this.cc.append(cc);
    }
43396
public synchronized Configuration loadConfiguration() {
    if (configurationBuffer.position(0).readByte() == 1) {
      int bytesLength = configurationBuffer.readInt();
      if (bytesLength == 0) {
        return null;
      }
      return serializer.decode(configurationBuffer.readBytes(bytesLength));
    }
    return null;
  }
966790
public static ClassLocation getClassLocation(final Node aNode, final Set<ClassLocation> classLocations) {


        if (aNode != null) {

            // The LocalName of the supplied DOM Node should be either "complexType" or "simpleType".
            final String nodeLocalName = aNode.getLocalName();
            final boolean acceptableType = "complexType".equalsIgnoreCase(nodeLocalName)
                    || "simpleType".equalsIgnoreCase(nodeLocalName);

            if (acceptableType) {

                final String nodeClassName = DomHelper.getNameAttribute(aNode);
                for (ClassLocation current : classLocations) {

                    // TODO: Ensure that the namespace of the supplied aNode matches the expected namespace.

                    // Issue #25: Handle XML Type renaming.
                    final String effectiveClassName = current.getAnnotationRenamedTo() == null
                            ? current.getClassName()
                            : current.getAnnotationRenamedTo();
                    if (effectiveClassName.equalsIgnoreCase(nodeClassName)) {
                        return current;
                    }
                }
            }
        }

        // Nothing found
        return null;
    }
459357
public static HierarchicalConfiguration getCurrentConfig() {
        SiteContext siteContext = SiteContext.getCurrent();
        if (siteContext != null) {
            return siteContext.getConfig();
        } else {
            return null;
        }
    }
1063962
protected static InputStream getConfigurationFileFromSDCard(String fileName) {
        File sdcard = Environment.getExternalStorageDirectory();
        if (sdcard == null || !sdcard.exists() || !sdcard.canRead()) {
            return null;
        }

        String sdCardPath = sdcard.getAbsolutePath();

        File propFile = new File(sdCardPath + "/" + fileName);
        if (!propFile.exists()) {
            return null;
        }

        FileInputStream fileIs = null;
        try {
            fileIs = new FileInputStream(propFile);
        } catch (FileNotFoundException e) {
            // should not happen, we check that above
            return null;
        }

        return fileIs;
    }
722011
public synchronized CmsContainerConfiguration getContainerConfiguration(String rootPath, String name) {

        String key = getCacheKey(rootPath);
        if (m_configurationsByPath.containsKey(key)) {
            CmsContainerConfigurationGroup group = m_configurationsByPath.get(key);
            CmsContainerConfiguration result = group.getConfiguration(name);
            return result;
        }
        return null;
    }
1103005
public Map<String, CmsXmlContentProperty> getSettingConfig(String containerName) {

        CmsFormatterConfig formatterConfig = getFormatterConfig(containerName);
        return formatterConfig != null
        ? formatterConfig.getSettingConfig()
        : Collections.<String, CmsXmlContentProperty> emptyMap();
    }
1323589
public static void reconfigure(String location) {
        System.setProperty(LoggingSystem.SYSTEM_PROPERTY,
            SpringBootLogbackReconfigure.class.getName());
        SpringBootLogbackReconfigure.xmlLocation = location;
    }
1267741
private void cacheDtdSystemId(I_CmsXmlConfiguration configuration) {

        if (configuration.getDtdSystemLocation() != null) {
            try {
                String file = CmsFileUtil.readFile(
                    configuration.getDtdSystemLocation() + configuration.getDtdFilename(),
                    CmsEncoder.ENCODING_UTF_8);
                CmsXmlEntityResolver.cacheSystemId(
                    configuration.getDtdUrlPrefix() + configuration.getDtdFilename(),
                    file.getBytes(CmsEncoder.ENCODING_UTF_8));
                if (LOG.isDebugEnabled()) {
                    LOG.debug(
                        Messages.get().getBundle().key(
                            Messages.LOG_CACHE_DTD_SYSTEM_ID_1,
                            configuration.getDtdUrlPrefix()
                                + configuration.getDtdFilename()
                                + " --> "
                                + configuration.getDtdSystemLocation()
                                + configuration.getDtdFilename()));
                }
            } catch (IOException e) {
                LOG.error(
                    Messages.get().getBundle().key(
                        Messages.LOG_CACHE_DTD_SYSTEM_ID_FAILURE_1,
                        configuration.getDtdSystemLocation() + configuration.getDtdFilename()),
                    e);
            }
        }
    }
1063554
private XmlElementFinder getElementFinder(final Element element) {
		if (elementFinder == null) {
			elementFinder = new XmlElementFinder(element.getDocument());
		}
		return elementFinder;
	}
645850
protected void parseSingleConfiguration(I_CmsXmlContentValueLocation location) {

        I_CmsXmlContentValueLocation nameLoc = location.getSubValue(N_NAME);
        if (nameLoc == null) {
            return;
        }
        String name = nameLoc.asString(m_cms);
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) {
            return;
        }
        List<String> ordering = null;
        List<I_CmsXmlContentValueLocation> orderKeyLocs = location.getSubValues(N_ORDERKEY);
        if (orderKeyLocs != null) {
            ordering = new ArrayList<String>();
            for (I_CmsXmlContentValueLocation orderKeyLoc : orderKeyLocs) {
                String orderKey = orderKeyLoc.asString(m_cms);
                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(orderKey)) {
                    ordering.add(orderKey.trim());
                }
            }
        }
        Map<String, Boolean> visibilities = new HashMap<String, Boolean>();
        List<I_CmsXmlContentValueLocation> visibleLocs = location.getSubValues(N_VISIBLE);
        for (I_CmsXmlContentValueLocation visibleLoc : visibleLocs) {
            String visibleStr = visibleLoc.asString(m_cms);
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(visibleStr)) {
                visibilities.put(visibleStr.trim(), Boolean.TRUE);
            }
        }

        List<I_CmsXmlContentValueLocation> hiddenLocs = location.getSubValues(N_HIDDEN);
        for (I_CmsXmlContentValueLocation hiddenLoc : hiddenLocs) {
            String hiddenStr = hiddenLoc.asString(m_cms);
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(hiddenStr)) {
                visibilities.put(hiddenStr.trim(), Boolean.FALSE);
            }
        }

        List<I_CmsXmlContentValueLocation> newElementLocs = location.getSubValues(N_NEWELEMENT);
        Map<String, CmsContainerElementBean> newElementBeans = new HashMap<String, CmsContainerElementBean>();
        for (I_CmsXmlContentValueLocation elementLoc : newElementLocs) {
            I_CmsXmlContentValueLocation keyLoc = elementLoc.getSubValue(N_KEY);
            String key = keyLoc.asString(m_cms).trim();
            I_CmsXmlContentValueLocation actualElementLoc = elementLoc.getSubValue(N_ELEMENT);
            I_CmsXmlContentValueLocation uriLoc = actualElementLoc.getSubValue(N_URI);
            CmsUUID structureId = uriLoc.asId(m_cms);
            if (structureId != null) {
                Map<String, String> settings = CmsXmlContentPropertyHelper.readProperties(m_cms, actualElementLoc);
                CmsContainerElementBean newElementBean = new CmsContainerElementBean(
                    structureId,
                    CmsUUID.getNullUUID(),
                    settings,
                    false);
                newElementBeans.put(key, newElementBean);
            }
        }
        CmsContainerConfiguration config = new CmsContainerConfiguration(ordering, visibilities, newElementBeans);
        m_currentConfigurationGroup.put(name, config);
    }
751536
private Region find(Region x) {
    Region current = this.root;
    while (current != NULL_NODE) {
      long res = x.orderRelativeTo(current);
      if (res < 0) {
        current = current.left;
      } else if (res > 0) {
        current = current.right;
      } else {
        return current;
      }
    }
    return null;
  }
748498
public InputStream getConfPathXmlStream(String filePathName){
     int i = filePathName.lastIndexOf(".xml");
     String name = filePathName.substring(0, i);
     name = name.replace('.', '/');
     name += ".xml";
     return getConfStream(name);
  }
1230725
public void setCc(Object cc) throws ApplicationException {
	if (StringUtil.isEmpty(cc)) return;
	try {
	    smtp.addCC(cc);
	}
	catch (Exception e) {
	    throw new ApplicationException("attribute [cc] of the tag [mail] is invalid", e.getMessage());
	}
    }
635245
public CmsDecorationDefintion getDecorationDefinition(CmsXmlContent configuration, int i) {

        CmsDecorationDefintion decDef = new CmsDecorationDefintion();
        String name = configuration.getValue(XPATH_DECORATION + "[" + i + "]/" + XPATH_NAME, m_configurationLocale).getStringValue(
            m_cms);
        String markfirst = configuration.getValue(
            XPATH_DECORATION + "[" + i + "]/" + XPATH_MARKFIRST,
            m_configurationLocale).getStringValue(m_cms);
        String pretext = configuration.getValue(
            XPATH_DECORATION + "[" + i + "]/" + XPATH_PRETEXT,
            m_configurationLocale).getStringValue(m_cms);
        String posttext = configuration.getValue(
            XPATH_DECORATION + "[" + i + "]/" + XPATH_POSTTEXT,
            m_configurationLocale).getStringValue(m_cms);
        String pretextfirst = configuration.getValue(
            XPATH_DECORATION + "[" + i + "]/" + XPATH_PRETEXTFIRST,
            m_configurationLocale).getStringValue(m_cms);
        String posttextfirst = configuration.getValue(
            XPATH_DECORATION + "[" + i + "]/" + XPATH_POSTTEXTFIRST,
            m_configurationLocale).getStringValue(m_cms);
        String filenname = configuration.getValue(
            XPATH_DECORATION + "[" + i + "]/" + XPATH_FILENAME,
            m_configurationLocale).getStringValue(m_cms);

        decDef.setName(name);
        decDef.setMarkFirst(markfirst.equals("true"));
        decDef.setPreText(pretext);
        decDef.setPostText(posttext);
        decDef.setPreTextFirst(pretextfirst);
        decDef.setPostTextFirst(posttextfirst);
        decDef.setConfigurationFile(filenname);

        return decDef;
    }
707106
public static MtasConfiguration readConfiguration(InputStream reader)
      throws IOException {
    MtasConfiguration currentConfig = null;
    // parse xml
    XMLInputFactory factory = XMLInputFactory.newInstance();
    try {
      XMLStreamReader streamReader = factory.createXMLStreamReader(reader);
      QName qname;
      try {
        int event = streamReader.getEventType();
        while (true) {
          switch (event) {
          case XMLStreamConstants.START_DOCUMENT:
            if (!streamReader.getCharacterEncodingScheme().equals("UTF-8")) {
              throw new IOException("XML not UTF-8 encoded");
            }
            break;
          case XMLStreamConstants.END_DOCUMENT:
          case XMLStreamConstants.SPACE:
            break;
          case XMLStreamConstants.START_ELEMENT:
            // get data
            qname = streamReader.getName();
            if (currentConfig == null) {
              if (qname.getLocalPart().equals("mtas")) {
                currentConfig = new MtasConfiguration();
              } else {
                throw new IOException("no Mtas Configuration");
              }
            } else {
              MtasConfiguration parentConfig = currentConfig;
              currentConfig = new MtasConfiguration();
              parentConfig.children.add(currentConfig);
              currentConfig.parent = parentConfig;
              currentConfig.name = qname.getLocalPart();
              for (int i = 0; i < streamReader.getAttributeCount(); i++) {
                currentConfig.attributes.put(
                    streamReader.getAttributeLocalName(i),
                    streamReader.getAttributeValue(i));
              }
            }
            break;
          case XMLStreamConstants.END_ELEMENT:
            if (currentConfig.parent == null) {
              return currentConfig;
            } else {
              currentConfig = currentConfig.parent;
            }
            break;
          case XMLStreamConstants.CHARACTERS:
            break;
          }
          if (!streamReader.hasNext()) {
            break;
          }
          event = streamReader.next();
        }
      } finally {
        streamReader.close();
      }
    } catch (XMLStreamException e) {
      log.debug(e);
    }
    return null;
  }