當前位置: 首頁>>代碼示例>>Java>>正文


Java StrSubstitutor.replaceSystemProperties方法代碼示例

本文整理匯總了Java中org.apache.commons.lang3.text.StrSubstitutor.replaceSystemProperties方法的典型用法代碼示例。如果您正苦於以下問題:Java StrSubstitutor.replaceSystemProperties方法的具體用法?Java StrSubstitutor.replaceSystemProperties怎麽用?Java StrSubstitutor.replaceSystemProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.lang3.text.StrSubstitutor的用法示例。


在下文中一共展示了StrSubstitutor.replaceSystemProperties方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateClasspath

import org.apache.commons.lang3.text.StrSubstitutor; //導入方法依賴的package包/類
private static List<String> generateClasspath(String classPath) throws FileNotFoundException {
    List<String> urlStr = new ArrayList<>();
    String realClassPath = StrSubstitutor.replaceSystemProperties(classPath);
    File classPathUrl = new File(realClassPath);

    if (!classPathUrl.exists()) {
        throw new FileNotFoundException("The classpath: " + realClassPath + " does not exist.");
    }

    if (classPathUrl.isFile()) {
        urlStr.add(classPathUrl.toURI().toString());
        return urlStr;
    }

    FileUtils.listFiles(classPathUrl, new String[] { "jar" }, false)
            .forEach((file) -> urlStr.add(file.toURI().toString()));

    return urlStr;
}
 
開發者ID:wso2,項目名稱:product-as,代碼行數:20,代碼來源:WebappClassLoaderContext.java

示例2: testCreateMetadata

import org.apache.commons.lang3.text.StrSubstitutor; //導入方法依賴的package包/類
@Test
public void testCreateMetadata() throws Exception {
    String entity = StrSubstitutor.replaceSystemProperties(loadResource("./metadata/test.json"));
    String response = createRequest((ResteasyClient client) -> {
        return client
                .target(getMetadataUrl())
                .path("/test/1.0.0");
    }).put(Entity.entity(entity, MediaType.APPLICATION_JSON), String.class);

    assertNotNull(response);
    JSONAssert.assertEquals(
            "{\"entityInfo\":{\"name\":\"test\",\"defaultVersion\":\"1.0.0\",\"indexes\":[{\"name\":null,\"unique\":true,\"fields\":[{\"field\":\"_id\",\"dir\":\"$asc\",\"caseInsensitive\":false}]}],\"datastore\":{\"datasource\":\"mongo\",\"collection\":\"test\",\"backend\":\"mongo\"},\"_id\":\"test|\"},\"schema\":{\"name\":\"test\",\"version\":{\"value\":\"1.0.0\",\"changelog\":\"test metadata\"},\"status\":{\"value\":\"active\"},\"access\":{\"insert\":[\"anyone\"],\"update\":[\"anyone\"],\"find\":[\"anyone\"],\"delete\":[\"anyone\"]},\"fields\":{\"_id\":{\"type\":\"string\",\"description\":null,\"valueGenerator\":{\"type\":\"UUID\"}},\"value\":{\"type\":\"string\",\"description\":null},\"objectType\":{\"type\":\"string\",\"description\":null,\"access\":{\"find\":[\"anyone\"],\"update\":[\"noone\"]},\"constraints\":{\"required\":true,\"minLength\":1}}},\"_id\":\"test|1.0.0\"}}",
            response,
            true);
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-rest,代碼行數:16,代碼來源:TestMetadataResource.java

示例3: json

import org.apache.commons.lang3.text.StrSubstitutor; //導入方法依賴的package包/類
public static JsonNode json(String s, boolean systemPropertySubstitution)
        throws IOException {
    String jsonString;
    if (systemPropertySubstitution) {
        // do system property expansion
        jsonString = StrSubstitutor.replaceSystemProperties(s);
    } else {
        jsonString = s;
    }
    return getObjectMapper().readTree(jsonString);
}
 
開發者ID:lightblue-platform,項目名稱:lightblue-core,代碼行數:12,代碼來源:JsonUtils.java

示例4: replacePlaceholdersWithWhiteSpace

import org.apache.commons.lang3.text.StrSubstitutor; //導入方法依賴的package包/類
public static String replacePlaceholdersWithWhiteSpace(final String templateContent) {
    return StrSubstitutor.replaceSystemProperties(templateContent);
}
 
開發者ID:arquillian,項目名稱:arquillian-cube,代碼行數:4,代碼來源:IOUtil.java

示例5: expandEnvVars

import org.apache.commons.lang3.text.StrSubstitutor; //導入方法依賴的package包/類
/**
 * Resolve variable given name to a global variable. Global variables are referenced using: ${var} convention.
 *
 * @param text
 *            object to use
 * @return resolved variable or itself if not a variable
 */
public String expandEnvVars(String text) {
	return StrSubstitutor.replaceSystemProperties(sub.replace(text));
}
 
開發者ID:Nastel,項目名稱:JESL,代碼行數:11,代碼來源:TNT4JSimulatorParserHandler.java


注:本文中的org.apache.commons.lang3.text.StrSubstitutor.replaceSystemProperties方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。