com.aeontronix.commons.SystemUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aeon-commons-core Show documentation
Show all versions of aeon-commons-core Show documentation
Various utility classes. Except for very rare exceptions (annotation-based validation) this will not
require any dependencies beyond the JRE
The newest version!
/*
* Copyright (c) 2014 Kloudtek Ltd
*/
package com.aeontronix.commons;
/**
* Various system level utility functions
*/
public class SystemUtils {
private static final String[] SERVER_TYPE_FILES = new String[]{"/etc/server-type"};
public static final boolean android;
static {
android = System.getProperty("java.vm.name").equalsIgnoreCase("Dalvik");
}
public static boolean isAndroid() {
return android;
}
public static boolean hasClass(String className) {
try {
Class.forName(className);
return true;
} catch (ClassNotFoundException e) {
return false;
}
}
}