Here you can find the source of mergeSystemProperties(Properties properties)
Parameter | Description |
---|---|
properties | Contains the properties to add to the list of system properties |
public static void mergeSystemProperties(Properties properties)
//package com.java2s; /*// ww w . j av a2 s . c o m * @(#)PropertyUtility.java * * Copyright 2003 by EkoLiving Pty Ltd. All Rights Reserved. * * This software is the proprietary information of EkoLiving Pty Ltd. * Use is subject to license terms. */ import java.util.*; public class Main { /** * Add properties to the system properties. Note that existing * system properties <u>WILL NOT</u> be overwritten by this method. * * @param properties Contains the properties to add to the list of system properties */ public static void mergeSystemProperties(Properties properties) { if (properties == null) return; Enumeration enumeration = properties.propertyNames(); while (enumeration.hasMoreElements()) { String name = (String) enumeration.nextElement(); if (System.getProperty(name) == null) { String value = properties.getProperty(name); System.setProperty(name, value); } } } }