private static NativeCalls getImplInstance() { if (Platform.isLinux()) { return new LinuxNativeCalls(); } if (Platform.isWindows()) { return new WinNativeCalls(); } if (Platform.isSolaris()) { return new SolarisNativeCalls(); } if (Platform.isMac()) { return new MacOSXNativeCalls(); } if (Platform.isFreeBSD()) { return new FreeBSDNativeCalls(); } return new POSIXNativeCalls(); }
} else if (Platform.isLinux() || Platform.isSolaris() || Platform.isAIX() || Platform.isFreeBSD() || Platform.isNetBSD() || Platform.isOpenBSD() || Platform.iskFreeBSD()) {
if (timeoutMillis == 0 && Platform.isSolaris()) {
private static String getNativeLibraryResourcePath() { String arch = System.getProperty("os.arch"); String osPrefix; if (Platform.isWindows()) { osPrefix = "win32-" + arch; } else if (Platform.isMac()) { osPrefix = "darwin"; } else if (Platform.isLinux()) { osPrefix = "linux-" + arch; } else if (Platform.isSolaris()) { osPrefix = "sunos-" + arch; } else { osPrefix = System.getProperty("os.name").toLowerCase(); int space = osPrefix.indexOf(" "); if (space != -1) { osPrefix = osPrefix.substring(0, space); } osPrefix += "-" + arch; } return "/com/sun/jna/" + osPrefix; }
private static String getClassPrefix() { return Platform.isWindows() ? "Win32" : Platform.isSolaris() ? "Sun" : (Platform.isMac() || Platform.isFreeBSD() || Platform.isOpenBSD()) ? "BSD" : "Unix"; }
private static String getClassPrefix() { return Platform.isWindows() ? "Win32" : Platform.isSolaris() ? "Sun" : (Platform.isMac() || Platform.isFreeBSD() || Platform.isOpenBSD()) ? "BSD" : "Unix"; }
@Override protected boolean couldHandleThisVirtualMachine() { final boolean result; if (isFreeBSD() || isLinux() || isOpenBSD() || isSolaris() || isMac()) { result = PROCESS_PID_FIELD != null; } else { result = false; } return result; }
private static String getClassPrefix() { return Platform.isWindows() ? "Win32" : Platform.isSolaris() ? "Sun" : (Platform.isMac() || Platform.isFreeBSD() || Platform.isOpenBSD()) ? "BSD" : "Unix"; }
public static JnaNativePty current() throws IOException { if (Platform.isMac()) { return OsXNativePty.current(); } else if (Platform.isLinux()) { return LinuxNativePty.current(); } else if (Platform.isSolaris()) { return SolarisNativePty.current(); } else if (Platform.isFreeBSD()) { return FreeBsdNativePty.current(); } else { throw new UnsupportedOperationException(); } }
public static JnaNativePty open(Attributes attr, Size size) throws IOException { if (Platform.isMac()) { return OsXNativePty.open(attr, size); } else if (Platform.isLinux()) { return LinuxNativePty.open(attr, size); } else if (Platform.isSolaris()) { return SolarisNativePty.open(attr, size); } else if (Platform.isFreeBSD()) { return FreeBsdNativePty.open(attr, size); } else { throw new UnsupportedOperationException(); } }
public static JnaNativePty open(Attributes attr, Size size) throws IOException { if (Platform.isMac()) { return OsXNativePty.open(attr, size); } else if (Platform.isLinux()) { return LinuxNativePty.open(attr, size); } else if (Platform.isSolaris()) { return SolarisNativePty.open(attr, size); } else if (Platform.isFreeBSD()) { return FreeBsdNativePty.open(attr, size); } else { throw new UnsupportedOperationException(); } }
public static JnaNativePty current() throws IOException { if (Platform.isMac()) { return OsXNativePty.current(); } else if (Platform.isLinux()) { return LinuxNativePty.current(); } else if (Platform.isSolaris()) { return SolarisNativePty.current(); } else if (Platform.isFreeBSD()) { return FreeBsdNativePty.current(); } else { throw new UnsupportedOperationException(); } }
@SuppressWarnings("rawtypes") public static String getCurrentUserName() { String className = null; String userName = null; String methodUsername = "getUsername"; if (Platform.isWindows()) { className = "com.sun.security.auth.module.NTSystem"; methodUsername = "getName"; } else if (Platform.isLinux()) { className = "com.sun.security.auth.module.UnixSystem"; } else if (Platform.isSolaris()) { className = "com.sun.security.auth.module.SolarisSystem"; } Class getclass = RefelectionUtils.getclass(className); Object contractorInstance = RefelectionUtils.getContractorInstance(getclass, new Object[] {}); Object method = RefelectionUtils.getMethod(contractorInstance, methodUsername, new Object[] {}); if (method != null) userName = (String) method; return userName; }
@SuppressWarnings("rawtypes") public static String getCurrentUserName() { String className = null; String userName = null; String methodUsername = "getUsername"; if (Platform.isWindows()) { className = "com.sun.security.auth.module.NTSystem"; methodUsername = "getName"; } else if (Platform.isLinux()) { className = "com.sun.security.auth.module.UnixSystem"; } else if (Platform.isSolaris()) { className = "com.sun.security.auth.module.SolarisSystem"; } Class getclass = RefelectionUtils.getclass(className); Object contractorInstance = RefelectionUtils.getContractorInstance(getclass, new Object[] {}); Object method = RefelectionUtils.getMethod(contractorInstance, methodUsername, new Object[] {}); if (method != null) userName = (String) method; return userName; }
private static CLibrary init() { if (Platform.isMac() || Platform.isOpenBSD()) { return (CLibrary) Native.loadLibrary("c", BSDCLibrary.class); } else if (Platform.isFreeBSD()) { return (CLibrary) Native.loadLibrary("c", FreeBSDCLibrary.class); } else if (Platform.isSolaris()) { return (CLibrary) Native.loadLibrary("c", SolarisCLibrary.class); } else if (Platform.isLinux()) { return (CLibrary) Native.loadLibrary("c", LinuxCLibrary.class); } else { return (CLibrary) Native.loadLibrary("c", CLibrary.class); } } }
if (timeoutMillis == 0 && Platform.isSolaris()) {
private static CLibrary init() { if (Platform.isMac() || Platform.isOpenBSD()) { return (CLibrary) Native.loadLibrary("c", BSDCLibrary.class); } else if (Platform.isFreeBSD()) { return (CLibrary) Native.loadLibrary("c", FreeBSDCLibrary.class); } else if (Platform.isSolaris()) { return (CLibrary) Native.loadLibrary("c", SolarisCLibrary.class); } else if (Platform.isLinux()) { return (CLibrary) Native.loadLibrary("c", LinuxCLibrary.class); } else { return (CLibrary) Native.loadLibrary("c", CLibrary.class); } } }
private static final NativeCalls getImplInstance() { if (Platform.isLinux()) { return new LinuxNativeCalls(); } if (Platform.isWindows()) { return new WinNativeCalls(); } if (Platform.isSolaris()) { return new SolarisNativeCalls(); } if (Platform.isMac()) { return new MacOSXNativeCalls(); } if (Platform.isFreeBSD()) { return new FreeBSDNativeCalls(); } return new POSIXNativeCalls(); }