asyc.hwid.OSUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of MultiOS-HWID Show documentation
Show all versions of MultiOS-HWID Show documentation
A java library to generate a unique ID of a computer; designed to be functional
with different operating systems.
The newest version!
package asyc.hwid;
import asyc.hwid.exception.UnsupportedOSException;
final class OSUtil {
private static String osName = System.getProperty("os.name").toLowerCase();
public static OS getCurrentOS() throws UnsupportedOSException {
if(osName.contains("win")){
return OS.WINDOWS;
}else if(osName.contains("mac")){
return OS.MAC;
}else if(osName.contains("nix") || osName.contains("nux") || osName.contains("aix")){
return OS.UNIX;
}else{
throw new UnsupportedOSException();
}
}
}
enum OS{
WINDOWS, MAC, UNIX
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy