• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PropertiesUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: 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));
	return userMappings;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:6,代码来源:EmployeeExportToLdap.java


示例17: processObsoleteCustomProperties

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
protected String processObsoleteCustomProperties(String liferayVersion,
		Properties customPortalProperties) throws IOException {
	if (customPortalProperties.isEmpty()) {
		return StringPool.BLANK;
	}

	StringBuilder stringBuilder = new StringBuilder();
	int index = Arrays.binarySearch(portalFileNames, liferayVersion);

	for (int i = index; i >= 0; i--) {
		boolean processedContext = false;
		Properties portalProperties = PropertiesUtil
				.load(getDefaultPortalProperties(portalFileNames[i]));
		SortedSet<String> keys = new TreeSet<String>(
				customPortalProperties.stringPropertyNames());
		Iterator<String> iterator = keys.iterator();

		while (iterator.hasNext()) {
			String key = iterator.next();

			if (portalProperties.containsKey(key)) {
				if (!processedContext) {
					stringBuilder.append("##\n## Obsolete properties of ");
					stringBuilder.append(portalFileNames[i]);
					stringBuilder.append("\n##\n\n");
					stringBuilder.append("    #\n");
					stringBuilder
							.append("    # The properties listed below are obsolete for version ");
					stringBuilder.append(liferayVersion);
					stringBuilder.append(" which\n");
					stringBuilder
							.append("    # means that they don't have any influence in how Liferay is configured\n");
					stringBuilder
							.append("    # and are safe be to removed.\n");
					stringBuilder.append("    #");

					processedContext = true;
				}

				String value = fixLineBreak(customPortalProperties
						.getProperty(key));

				stringBuilder.append("\n");
				stringBuilder.append("    #" + key + "=" + value);
				customPortalProperties.remove(key);
			}
		}
		if (processedContext) {
			stringBuilder.append("\n");
			stringBuilder.append("\n");
		}
	}

	return stringBuilder.toString();
}
 
开发者ID:tmoreira2020,项目名称:portal-properties-prettier-app,代码行数:56,代码来源:PortalPropertiesPrettier.java


示例18: dropIndexes

import com.liferay.portal.kernel.util.PropertiesUtil; //导入依赖的package包/类
protected Set<String> dropIndexes(
		Connection con, String tablesSQL, String indexesSQL,
		String indexesProperties, List<Index> indexes)
	throws IOException, SQLException {

	if (_log.isInfoEnabled()) {
		_log.info("Dropping stale indexes");
	}

	Set<String> validIndexNames = new HashSet<String>();

	if (indexes.isEmpty()) {
		return validIndexNames;
	}

	String tablesSQLLowerCase = tablesSQL.toLowerCase();
	String indexesSQLLowerCase = indexesSQL.toLowerCase();

	Properties indexesPropertiesObj = PropertiesUtil.load(
		indexesProperties);

	Enumeration<String> enu =
		(Enumeration<String>)indexesPropertiesObj.propertyNames();

	while (enu.hasMoreElements()) {
		String key = enu.nextElement();

		String value = indexesPropertiesObj.getProperty(key);

		indexesPropertiesObj.setProperty(key.toLowerCase(), value);
	}

	for (Index index : indexes) {
		String indexNameUpperCase = index.getIndexName().toUpperCase();
		String indexNameLowerCase = indexNameUpperCase.toLowerCase();
		String tableName = index.getTableName();
		String tableNameLowerCase = tableName.toLowerCase();
		boolean unique = index.isUnique();

		validIndexNames.add(indexNameUpperCase);

		if (indexesPropertiesObj.containsKey(indexNameLowerCase)) {
			if (unique &&
				indexesSQLLowerCase.contains(
					"create unique index " + indexNameLowerCase + " ")) {

				continue;
			}

			if (!unique &&
				indexesSQLLowerCase.contains(
					"create index " + indexNameLowerCase + " ")) {

				continue;
			}
		}
		else if (!tablesSQLLowerCase.contains(
					"create table " + tableNameLowerCase + " (")) {

			continue;
		}

		validIndexNames.remove(indexNameUpperCase);

		String sql =
			"drop index " + indexNameUpperCase + " on " + tableName;

		if (_log.isInfoEnabled()) {
			_log.info(sql);
		}

		runSQL(con, sql);
	}

	return validIndexNames;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:77,代码来源:BaseDB.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockEntityItemFrame类代码示例发布时间:2022-05-22
下一篇:
Java VmSchedulerTimeSharedOverSubscription类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap