当前位置: 首页>>代码示例>>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;未经允许,请勿转载。