Here you can find the source of getStringConfigVaule(Properties properties, String key, String defaultValue)
public static String getStringConfigVaule(Properties properties, String key, String defaultValue)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static String getStringConfigVaule(Properties properties, String key, String defaultValue) { return checkConfigValue(properties, key, defaultValue) ? properties.getProperty(key) : null; }/*w w w. jav a 2s. c o m*/ public static String getStringConfigVaule(Properties properties, String key) { return getStringConfigVaule(properties, key, null); } public static boolean checkConfigValue(Properties properties, String key) { return checkConfigValue(properties, key, null); } public static boolean checkConfigValue(Properties properties, String key, String defaultValue) { return checkConfigValue(properties, key, defaultValue, null); } public static boolean checkConfigValue(Properties properties, String key, String defaultValue, String errorMessage) { String value = System.getProperty(key); if (value == null || value.equals("")) { value = properties.getProperty(key, defaultValue); if (value == null || value.equals("")) { return false; } else { properties.setProperty(key, value); return true; } } else { properties.setProperty(key, value); return true; } } }