Reads the XML content value for a given xpath.<p>

Returns null if no value was found at that path.<p>

@param path the XML content xpath

@return the value for that path as a string
778402
private String getStringValue(String path) {

        I_CmsXmlContentValue value = m_content.getValue(path, Locale.ENGLISH);
        if (value == null) {
            return null;
        } else {
            return value.getStringValue(m_cms);
        }
    }
1143588
@Override
    public InputStream getResourceAsStream( String path )
    {
        Object in = null;
        if ( null != baseLoader )
            // classloader wants no leading slash
            in = baseLoader.getResourceAsStream( path.substring(1) );
        if ( null == in )
            return super.getResourceAsStream( path );
        return (InputStream) in;
    }
712447
public static XmlPath parse(String xmlPathQuery) {
        // validations
        if(xmlPathQuery == null) {
            throw new XmlPathException("The XML path query can not be a null value");
        }
        xmlPathQuery = xmlPathQuery.trim();

        // simple patterns
        if(! xmlPathQuery.contains("/")) {
            if("*".equals(xmlPathQuery)) {
                return new XmlPath(new XmlPathAnyElement());
            } else if("@*".equals(xmlPathQuery)) {
                return new XmlPath(new XmlPathAnyAttributeElement());
            } else if("node()".equals(xmlPathQuery)) {
                return new XmlPath(new XmlPathAnyNode());
            } else if(xmlPathQuery.matches(XmlPathNodenameAttribute.REGEX_MATCH)) {
                return new XmlPath(new XmlPathNodenameAttribute(xmlPathQuery));
            } else if(xmlPathQuery.matches(XmlPathNodename.REGEX_MATCH)) {
                return new XmlPath(new XmlPathNodename(xmlPathQuery));
            }
        }

        // sub-tree patterns
        Matcher m = rePath.matcher(xmlPathQuery);
        if(! m.matches()) {
            throw new XmlPathException("Invalid xml path query: " + xmlPathQuery);
        }

        XmlPath.Builder builder = XmlPath.builder();
        m = rePathPart.matcher(xmlPathQuery);
        while(m.find()) {
            String part = m.group(1);
            if("*".equals(part)) {
                builder.add(new XmlPathAnyElement());
            } else if("@*".equals(part)) {
                builder.add(new XmlPathAnyAttributeElement());
            } else if("node()".equals(part)) {
                builder.add(new XmlPathAnyNode());
            } else if(part.matches(XmlPathNodenameAttribute.REGEX_MATCH)) {
                builder.add(new XmlPathNodenameAttribute(part));
            } else if (part.matches(XmlPathNodename.REGEX_MATCH)) {
                builder.add(new XmlPathNodename(part));
            } else {
                throw new XmlPathException("Invalid part(" + part + ") in xml path query: " + xmlPathQuery);
            }
        }
        return builder.construct();
    }
761793
protected Properties readConfigFile(String path) {
		Properties props = new Properties();
		// Load properties file
		InputStream is = null;
		try {
			if (path.startsWith(FILE_PREFIX)) {
				if (LOGGER.isDebugEnabled() && !checking)
					LOGGER.debug("Using filesystem properties file location at: " + configLocation);
				is = new FileInputStream(new File(path.substring(FILE_PREFIX.length())));
			} else {
				if (LOGGER.isDebugEnabled() && !checking)
					LOGGER.debug("Reading properties from file at classpath: " + configLocation);
				is = ClassLoaderResourceUtils.getResourceAsStream(path, this);
			}
			loadConfig(props, path, is);

		} catch (IOException e) {
			throw new IllegalArgumentException("jawr configuration could not be found at " + path
					+ ". Make sure parameter is properly set " + "in web.xml. ");
		} finally {
			IOUtils.close(is);
		}

		return props;
	}
1163570
public final String getTextDefault(String defaultValue, String... path)
    {
        final Xml node = getNodeDefault(path);
        if (node != null)
        {
            return node.getText();
        }
        return defaultValue;
    }
491727
public RFuture<String> getText (final String path) {
    final RPromise<String> result = exec.deferredPromise();
    exec.invokeAsync(new Runnable() {
      public void run () {
        try {
          result.succeed(getTextSync(path));
        } catch (Throwable t) {
          result.fail(t);
        }
      }
    });
    return result;
  }
911940
public static String readString(Path targetPath) {
        try {
            return new String(Files.readAllBytes(targetPath));
        } catch (IOException e) {
            return JMExceptionManager.handleExceptionAndReturnNull(log, e,
                    "readString", targetPath);
        }
    }
812129
private CmsType readTypes(CmsXmlContentDefinition xmlContentDefinition, String path) {

        String typeName = (CmsStringUtil.isEmptyOrWhitespaceOnly(path) ? "" : (path + ":"))
            + CmsContentService.getTypeUri(xmlContentDefinition);
        if (m_registeredTypes.containsKey(typeName)) {
            return m_registeredTypes.get(typeName);
        }
        CmsType type = new CmsType(typeName);
        type.setChoiceMaxOccurrence(xmlContentDefinition.getChoiceMaxOccurs());
        m_registeredTypes.put(typeName, type);
        CmsType choiceType = null;
        if (type.isChoice()) {
            choiceType = new CmsType(typeName + "/" + CmsType.CHOICE_ATTRIBUTE_NAME);
            m_registeredTypes.put(choiceType.getId(), choiceType);
            type.addAttribute(CmsType.CHOICE_ATTRIBUTE_NAME, choiceType, 1, xmlContentDefinition.getChoiceMaxOccurs());
        }
        ArrayList<DisplayTypeEvaluator> evaluators = new ArrayList<DisplayTypeEvaluator>();
        for (I_CmsXmlSchemaType subType : xmlContentDefinition.getTypeSequence()) {

            String subTypeName = null;
            String childPath = path + "/" + subType.getName();
            String subAttributeName = CmsContentService.getAttributeName(subType.getName(), typeName);
            DisplayTypeEvaluator ev = readConfiguration((A_CmsXmlContentValue)subType, childPath);
            ev.setAttributeName(subAttributeName);
            evaluators.add(ev);
            CmsType subEntityType;
            if (subType.isSimpleType()) {
                subTypeName = CmsContentService.TYPE_NAME_PREFIX + subType.getTypeName();
                if (!m_registeredTypes.containsKey(subTypeName)) {
                    subEntityType = new CmsType(subTypeName);
                    m_registeredTypes.put(subTypeName, subEntityType);
                } else {
                    subEntityType = m_registeredTypes.get(subTypeName);
                }
            } else {
                CmsXmlContentDefinition subTypeDefinition = ((CmsXmlNestedContentDefinition)subType).getNestedContentDefinition();
                subTypeName = CmsContentService.getTypeUri(subTypeDefinition);
                subEntityType = readTypes(subTypeDefinition, childPath);
            }
            if (choiceType != null) {
                choiceType.addAttribute(
                    subAttributeName,
                    subEntityType,
                    subType.getMinOccurs(),
                    subType.getMaxOccurs());
            } else {
                type.addAttribute(subAttributeName, subEntityType, subType.getMinOccurs(), subType.getMaxOccurs());
            }
        }
        DisplayType predecessor = null;
        for (int i = 0; i < evaluators.size(); i++) {
            DisplayTypeEvaluator ev = evaluators.get(i);
            DisplayType successor = ((i + 1) < evaluators.size()) ? evaluators.get(i + 1).getProposedType() : null;
            CmsAttributeConfiguration evaluated = ev.getEvaluatedConfiguration(predecessor, successor);
            m_attributeConfigurations.put(ev.getAttributeName(), evaluated);
            if (evaluated.isLocaleSynchronized()) {
                m_localeSynchronizations.add(ev.getAttributeName());
            }
            if (evaluated.isDynamicallyLoaded()) {
                m_dynamicallyLoaded.add(ev.getAttributeName());
            }
            predecessor = DisplayType.valueOf(evaluated.getDisplayType());
        }
        return type;
    }
820804
@Override
    public URL getResource( String path )
    {
        URL url = null;
        if ( baseLoader != null )
            // classloader wants no leading slash
            url = baseLoader.getResource( path.substring(1) );
        if ( url == null )
            url = super.getResource( path );
        return url;
    }
814509
public static String readResourceAsStream(String path) {
        try {
            InputStream inputStream = ResourceUtil.getResourceAsStream(path);
            return ResourceUtil.readFromInputStreamIntoString(inputStream);
        } catch (Exception e) {
            throw new DataUtilException("Failed to load resource", e);
        }
    }
1297542
public String getConfigurationContentStringValue(String path) {

        if (getConfigurationContent() != null) {
            return getConfigurationContent().getStringValue(getCms(), path, getLocale());
        }
        return "";
    }
476162
public void getLink(String path, final I_CmsStringCallback callback) {

        m_apiRoot.getRpcHelper().executeRpc(CmsXmlContentUgcApi.SERVICE.getLink(path, new AsyncCallback<String>() {

            @SuppressWarnings("synthetic-access")
            public void onFailure(Throwable caught) {

                m_apiRoot.handleError(caught, null);
            }

            public void onSuccess(String result) {

                callback.call(result);
            }
        }));
    }
296960
public static String readResource(Class<?> clazz, String path)
    {
        File targetFile = resolve(clazz, path);
        if (targetFile == null)
        {
            return null;
        }

        String result;

        try
        {
            result = FileUtils.readFileToString(targetFile, "UTF-8");
        }
        catch (IOException ex)
        {
            return null;
        }

        return result;
    }
5608
public static String readResource(String path)
    {
        Class<?> callerClass = resolveCaller();
        if (callerClass == null)
        {
            return null;
        }

        return readResource(resolveCaller(), path);
    }
54867
public ValueAssert valueByXPath(String xPath) {
        isNotNull();
        try {
            return ValueAssert.create(actual, prefix2Uri, dbf, xpf, xPath);
        } catch (Exception e) {
            throwAssertionError(shouldNotHaveThrown(e));
        }
        return null; //fix compile issue
    }
374195
public StringPath get(StringPath path) {
        StringPath newPath = getString(toString(path));
        return addMetadataOf(newPath, path);
    }
117853
public static String getResource(final String path) {
		final InputStream stream = getResourceStream(path);
		final BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
		final Stream<String> lines = reader.lines();
		return lines.collect(Collectors.joining("\n"));
	}