Here you can find the source of getProperty(Properties props, String propertyName)
Parameter | Description |
---|---|
props | config file |
propertyName | config/cmd property name |
public static String getProperty(Properties props, String propertyName)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**//from w w w . j a v a2s .co m * Reads system variable (cmd option) or config file value on fail * * @param props config file * @param propertyName config/cmd property name * @return value */ public static String getProperty(Properties props, String propertyName) { return System.getProperty(propertyName, props.getProperty(propertyName)); } /** * Reads system variable (cmd option) or config file value on fail * * @param props config file to get value from if not specified via cmd * @param propertyName config/cmd property name to get value from * @param defaultValue value to use if not specified via cmd and config * @return value */ public static String getProperty(Properties props, String propertyName, String defaultValue) { return System.getProperty(propertyName, props.getProperty(propertyName, defaultValue)); } }