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

com.webapp.utils.config.SysUtils Maven / Gradle / Ivy

The newest version!
package com.webapp.utils.config;

public class SysUtils {

	public static boolean isWin() {
		return getSys().startsWith("Windows") ? true : false;
	}
	public static boolean isLinux() {
		return getSys().startsWith("Linux") ? true : false;
	}
	private static String getSys() {
		return System.getProperty("os.name");
	}

	public static String getJavaPath() {
		return System.getProperty("sun.boot.library.path");
	}

	public static String getUserHome() {
		return System.getProperty("user.home");
	}

	public static String getJavaVersion() {
		return System.getProperty("java.runtime.version");
	}

	public static String getUserPath() {
		return System.getProperty("user.dir");
	}

	public static void listProps() {
		System.getProperties().forEach((k, v) -> {System.out.println(k + " -> " + v);});
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy