当前位置: 首页>>代码示例>>Java>>正文


Java PropertiesUtil类代码示例

本文整理汇总了Java中com.liferay.portal.kernel.util.PropertiesUtil的典型用法代码示例。如果您正苦于以下问题:Java PropertiesUtil类的具体用法?Java PropertiesUtil怎么用?Java PropertiesUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PropertiesUtil类属于com.liferay.portal.kernel.util包,在下文中一共展示了PropertiesUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prettify

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
protected String prettify(PortletRequest request) throws IOException,
		PortletException {
	UploadPortletRequest uploadPortletRequest = PortalUtil
			.getUploadPortletRequest(request);

	String liferayVersion = ParamUtil.getString(uploadPortletRequest,
			"liferayVersion", "7.0.4-ga5");
	boolean printDefaultValue = ParamUtil.getBoolean(uploadPortletRequest,
			"printDefaultValue");

	Properties customProperties = PropertiesUtil.load(
			uploadPortletRequest.getFileAsStream("portalPropertiesFile"),
			"UTF-8");

	String prettyProperties = prettier.prettify(customProperties,
			liferayVersion, printDefaultValue);

	incrementCounter(request);

	return prettyProperties;
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:22,代码来源:PortalPropertiesPrettierPortlet.java

示例2: testIssue10

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue10() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-10-expected.properties");
	String actual = getContent("/portal-issue-10.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4");

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例3: testIssue12

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue12() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-12-expected.properties");
	String actual = getContent("/portal-issue-12.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4");

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例4: testIssue13

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue13() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-13-expected.properties");
	String actual = getContent("/portal-issue-13.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", true);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例5: testIssue18

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue18() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-18-expected.properties");
	String actual = getContent("/portal-issue-18.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", true);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例6: testIssue19

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue19() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-19-expected.properties");
	String actual = getContent("/portal-issue-19.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", true);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例7: testIssue22

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue22() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-22-expected.properties");
	String actual = getContent("/portal-issue-22.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", false);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例8: testIssue27DB2

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue27DB2() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-27-db2-expected.properties");
	String actual = getContent("/portal-issue-27-db2.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", false);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例9: testIssue27Derby

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue27Derby() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-27-derby-expected.properties");
	String actual = getContent("/portal-issue-27-derby.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", false);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例10: testIssue27MySQL

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue27MySQL() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-27-mysql-expected.properties");
	String actual = getContent("/portal-issue-27-mysql.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", false);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例11: testIssue27SQLServer

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue27SQLServer() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-27-sqlserver-expected.properties");
	String actual = getContent("/portal-issue-27-sqlserver.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", false);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例12: testIssue28

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue28() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-28-expected.properties");
	String actual = getContent("/portal-issue-28.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", false);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例13: testIssue30

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
@Test
public void testIssue30() throws Exception {
	PortalPropertiesPrettier prettier = new PortalPropertiesPrettier();
	String expected = getContent("/portal-issue-30-expected.properties");
	String actual = getContent("/portal-issue-30.properties");
	Properties customProperties = PropertiesUtil.load(actual);

	actual = prettier.prettify(customProperties, "6.2.3-ga4", false);

	Assert.assertEquals(expected, actual);
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:12,代码来源:PortalPropertiesPrettierTest.java

示例14: getPluginPackageProperties

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
protected Properties getPluginPackageProperties(
	ServletContext servletContext) {

	Properties properties = new Properties();

	try {
		String propertiesString = StringUtil.read(
			servletContext.getResourceAsStream(
				"/WEB-INF/liferay-plugin-package.properties"));

		if (propertiesString == null) {
			return properties;
		}

		String contextPath = servletContext.getRealPath(StringPool.SLASH);

		contextPath = StringUtil.replace(
			contextPath, StringPool.BACK_SLASH, StringPool.SLASH);

		propertiesString = propertiesString.replace(
			"${context.path}", contextPath);

		PropertiesUtil.load(properties, propertiesString);
	}
	catch (IOException ioe) {
		_log.error(ioe, ioe);
	}

	return properties;
}
 
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:31,代码来源:ResourcesImporterHotDeployMessageListener.java

示例15: getUserMappings

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
public Properties getUserMappings(long companyId) throws Exception {
	Properties userMappings = PropertiesUtil.load(PrefsPropsUtil.getString(
			companyId, PropsKeys.LDAP_USER_MAPPINGS));
	LogUtil.debug(_log, userMappings);
	return userMappings;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:7,代码来源:ManagerLdap.java


注:本文中的com.liferay.portal.kernel.util.PropertiesUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。