서버 테스트 반영
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.eactive.ext.kjb.utils;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
public class OsUtil {
|
||||
public static boolean isWindows() {
|
||||
return System.getProperty("os.name").toLowerCase().contains("win");
|
||||
}
|
||||
|
||||
public static boolean isLinux() {
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
return os.contains("nux") || os.contains("nix") || os.contains("aix") ;
|
||||
}
|
||||
|
||||
public static String getHostName() {
|
||||
try {
|
||||
return InetAddress.getLocalHost().getHostName();
|
||||
} catch (Exception e) {
|
||||
String name = System.getProperty("COMPUTERNAME");
|
||||
if (name == null) name = System.getenv("HOSTNAME");
|
||||
return name != null ? name : "unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user