當前位置: 首頁>>代碼示例>>Java>>正文


Java Platform.isFreeBSD方法代碼示例

本文整理匯總了Java中com.sun.jna.Platform.isFreeBSD方法的典型用法代碼示例。如果您正苦於以下問題:Java Platform.isFreeBSD方法的具體用法?Java Platform.isFreeBSD怎麽用?Java Platform.isFreeBSD使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sun.jna.Platform的用法示例。


在下文中一共展示了Platform.isFreeBSD方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getImplInstance

import com.sun.jna.Platform; //導入方法依賴的package包/類
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();
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:19,代碼來源:NativeCallsJNAImpl.java

示例2: getPlatformFolder

import com.sun.jna.Platform; //導入方法依賴的package包/類
private static String getPlatformFolder() {
    String result;

    if (Platform.isMac()) {
        result = "macosx";
    } else if (Platform.isWindows()) {
        result = "win";
    } else if (Platform.isLinux()) {
        result = "linux";
    } else if (Platform.isFreeBSD()) {
        result = "freebsd";
    } else if (Platform.isOpenBSD()) {
        result = "openbsd";
    } else {
        throw new IllegalStateException("Platform " + Platform.getOSType() + " is not supported");
    }

    return result;
}
 
開發者ID:Coding,項目名稱:WebIDE-Backend,代碼行數:20,代碼來源:PtyUtil.java

示例3: getUnixUID

import com.sun.jna.Platform; //導入方法依賴的package包/類
/**
 * Gets the user ID on Unix based systems. This should not change during a
 * session and the lookup is expensive, so we cache the result.
 *
 * @return The Unix user ID
 * @throws IOException
 */
public static int getUnixUID() throws IOException {
	if (
		Platform.isAIX() || Platform.isFreeBSD() || Platform.isGNU() || Platform.iskFreeBSD() ||
		Platform.isLinux() || Platform.isMac() || Platform.isNetBSD() || Platform.isOpenBSD() ||
		Platform.isSolaris()
	) {
		synchronized (unixUIDLock) {
			if (unixUID < 0) {
				String response;
			    Process id;
				id = Runtime.getRuntime().exec("id -u");
			    try (BufferedReader reader = new BufferedReader(new InputStreamReader(id.getInputStream(), Charset.defaultCharset()))) {
			    	response = reader.readLine();
			    }
			    try {
			    	unixUID = Integer.parseInt(response);
			    } catch (NumberFormatException e) {
			    	throw new UnsupportedOperationException("Unexpected response from OS: " + response, e);
			    }
			}
			return unixUID;
		}
	}
	throw new UnsupportedOperationException("getUnixUID can only be called on Unix based OS'es");
}
 
開發者ID:DigitalMediaServer,項目名稱:DigitalMediaServer,代碼行數:33,代碼來源:FileUtil.java

示例4: getPipeProcess

import com.sun.jna.Platform; //導入方法依賴的package包/類
public ProcessWrapper getPipeProcess() {
	if (!Platform.isWindows()) {
		OutputParams mkfifo_vid_params = new OutputParams(configuration);
		mkfifo_vid_params.maxBufferSize = 0.1;
		mkfifo_vid_params.log = true;
		String cmdArray[];

		if (Platform.isMac() || Platform.isFreeBSD() || Platform.isSolaris()) {
			cmdArray = new String[] {"mkfifo", "-m", "777", linuxPipeName};
		} else {
			cmdArray = new String[] {"mkfifo", "--mode=777", linuxPipeName};
		}

		ProcessWrapperImpl mkfifo_vid_process = new ProcessWrapperImpl(cmdArray, mkfifo_vid_params);
		return mkfifo_vid_process;
	}

	return mk;
}
 
開發者ID:DigitalMediaServer,項目名稱:DigitalMediaServer,代碼行數:20,代碼來源:PipeProcess.java

示例5: getPlatformFolder

import com.sun.jna.Platform; //導入方法依賴的package包/類
private static String getPlatformFolder() {
  String result;

  if (Platform.isMac()) {
    result = "macosx";
  } else if (Platform.isWindows()) {
    result = "win";
  } else if (Platform.isLinux()) {
    result = "linux";
  } else if (Platform.isFreeBSD()) {
    result = "freebsd";
  } else if (Platform.isOpenBSD()) {
    result = "openbsd";
  } else {
    throw new IllegalStateException("Platform " + Platform.getOSType() + " is not supported");
  }

  return result;
}
 
開發者ID:traff,項目名稱:pty4j,代碼行數:20,代碼來源:PtyUtil.java

示例6: mapSharedLibraryName

import com.sun.jna.Platform; //導入方法依賴的package包/類
static String mapSharedLibraryName(String libName) {
    if (Platform.isMac()) {
        if (libName.startsWith("lib")
            && (libName.endsWith(".dylib")
                || libName.endsWith(".jnilib"))) {
            return libName;
        }
        String name = System.mapLibraryName(libName);
        // On MacOSX, System.mapLibraryName() returns the .jnilib extension
        // (the suffix for JNI libraries); ordinarily shared libraries have
        // a .dylib suffix
        if (name.endsWith(".jnilib")) {
            return name.substring(0, name.lastIndexOf(".jnilib")) + ".dylib";
        }
        return name;
    }
    else if (Platform.isLinux() || Platform.isFreeBSD()) {
        if (isVersionedName(libName) || libName.endsWith(".so")) {
            // A specific version was requested - use as is for search
            return libName;
        }
    }
    else if (Platform.isAIX()) {	// can be libx.a, libx.a(shr.o), libx.so
        if (libName.startsWith("lib")) {
            return libName;
        }
    }
    else if (Platform.isWindows()) {
        if (libName.endsWith(".drv") || libName.endsWith(".dll")) {
            return libName;
        }
    }

    return System.mapLibraryName(libName);
}
 
開發者ID:xtuhcy,項目名稱:webkit4j,代碼行數:36,代碼來源:InstallLibs.java

示例7: getNativeLibraryName

import com.sun.jna.Platform; //導入方法依賴的package包/類
private static String getNativeLibraryName() {
    String result;

    if (Platform.isMac()) {
        result = "libpty.dylib";
    } else if (Platform.isWindows()) {
        result = "winpty.dll";
    } else if (Platform.isLinux() || Platform.isFreeBSD() || Platform.isOpenBSD()) {
        result = "libpty.so";
    } else {
        throw new IllegalStateException("Platform " + Platform.getOSType() + " is not supported");
    }

    return result;
}
 
開發者ID:Coding,項目名稱:WebIDE-Backend,代碼行數:16,代碼來源:PtyUtil.java

示例8: isBsdish

import com.sun.jna.Platform; //導入方法依賴的package包/類
private static boolean isBsdish() {
  return Platform.isMac()
      || Platform.isFreeBSD()
      || Platform.isNetBSD()
      || Platform.isOpenBSD()
      || Platform.iskFreeBSD();
}
 
開發者ID:facebook,項目名稱:buck,代碼行數:8,代碼來源:UnixDomainSocketLibrary.java

示例9: getNativeLibraryName

import com.sun.jna.Platform; //導入方法依賴的package包/類
private static String getNativeLibraryName() {
  String result;

  if (Platform.isMac()) {
    result = "libpty.dylib";
  } else if (Platform.isWindows()) {
    result = "winpty.dll";
  } else if (Platform.isLinux() || Platform.isFreeBSD() || Platform.isOpenBSD()) {
    result = "libpty.so";
  } else {
    throw new IllegalStateException("Platform " + Platform.getOSType() + " is not supported");
  }

  return result;
}
 
開發者ID:traff,項目名稱:pty4j,代碼行數:16,代碼來源:PtyUtil.java

示例10: preparePingCommand

import com.sun.jna.Platform; //導入方法依賴的package包/類
private String[] preparePingCommand(int count) {
  String value = Integer.toString(count);
  if (Platform.isWindows()) {
    return new String[]{"ping", "-n", value, "127.0.0.1"};
  } else if (Platform.isSolaris()) {
    return new String[]{"/usr/sbin/ping", "-s", "127.0.0.1", "64", value};
  } else if (Platform.isMac() || Platform.isFreeBSD() || Platform.isOpenBSD()) {
    return new String[]{"/sbin/ping", "-c", value, "127.0.0.1"};
  } else if (Platform.isLinux()) {
    return new String[]{"/bin/ping", "-c", value, "127.0.0.1"};
  }

  throw new RuntimeException("Unsupported platform!");
}
 
開發者ID:traff,項目名稱:pty4j,代碼行數:15,代碼來源:PtyTest.java

示例11: getClassPrefix

import com.sun.jna.Platform; //導入方法依賴的package包/類
private static String getClassPrefix() {
    return Platform.isWindows() ? "Win32" 
          : Platform.isSolaris() ? "Sun" 
          : (Platform.isMac() || Platform.isFreeBSD() || Platform.isOpenBSD()) ? "BSD" 
          : "Unix";
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:7,代碼來源:NativeDatagramSocket.java


注:本文中的com.sun.jna.Platform.isFreeBSD方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。