All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mentalog.util.SystemUtils Maven / Gradle / Ivy

There is a newer version: 2.1.2
Show newest version
package org.mentalog.util;

public class SystemUtils {
	
	public static boolean getBoolean(String name, boolean def) {
		
		String s = System.getenv(name);
		
		if (s == null) s = System.getProperty(name);
		
		if (s == null) return def;
		
		return s.equals("true");
	}
	
	public static boolean getBoolean(String name) {
		
		return getBoolean(name, false);
	}
	
	public static String getString(String name, String def) {
		
		String s = System.getenv(name);
		
		if (s == null) s = System.getProperty(name);
		
		if (s == null) return def;
		
		return s;
	}
	
	public static String getString(String name) {
		
		return getString(name, null);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy