com.sun.enterprise.util.OS.isUNIX()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中com.sun.enterprise.util.OS.isUNIX()方法的一些代码示例,展示了OS.isUNIX()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OS.isUNIX()方法的具体详情如下:
包路径:com.sun.enterprise.util.OS
类名称:OS
方法名:isUNIX

OS.isUNIX介绍

暂无

代码示例

代码示例来源:origin: org.glassfish.common/common-util

public static boolean isUnix()
{
  // convenience method...
  return isUNIX();
}

代码示例来源:origin: eclipse-ee4j/glassfish

public static boolean isUnix()
{
  // convenience method...
  return isUNIX();
}

代码示例来源:origin: org.glassfish.main.common/common-util

public static boolean isUnix()
{
  // convenience method...
  return isUNIX();
}

代码示例来源:origin: org.glassfish.main.cluster/cluster-cli

protected void chmod(String args, File file) throws IOException {
  if (OS.isUNIX()) {
    if (!file.exists()) throw new IOException(Strings.get("fileNotFound", file.getAbsolutePath()));
    // " +" regular expression for 1 or more spaces
    final String[] argsString = args.split(" +");
    List<String> cmdList = new ArrayList<String>();
    cmdList.add("/bin/chmod");
    for (String arg : argsString)
      cmdList.add(arg);
    cmdList.add(file.getAbsolutePath());
    new ProcessBuilder(cmdList).start();
  }
}

代码示例来源:origin: org.glassfish.main.admin/server-mgmt

protected void chmod(String args, File file) throws IOException {
  if (OS.isUNIX()) {
    //args and file should never be null.
    if (args == null || file == null)
      throw new IOException(_strMgr.getString("nullArg"));
    if (!file.exists())
      throw new IOException(_strMgr.getString("fileNotFound"));
    // " +" regular expression for 1 or more spaces
    final String[] argsString = args.split(" +");
    List<String> cmdList = new ArrayList<String>();
    cmdList.add("/bin/chmod");
    cmdList.addAll(Arrays.asList(argsString));
    cmdList.add(file.getAbsolutePath());
    new ProcessBuilder(cmdList).start();
  }
}

代码示例来源:origin: org.glassfish.main.admin/backup

/**
 **/

public static boolean makeExecutable(File f)
{
  if(!OS.isUNIX())
    return true;	// no such thing in Windows...
  
  if(!f.exists())
    return true; // no harm, no foul...
  
  if(!f.isDirectory())
    return makeExecutable(new File[] { f} );
  
  // if we get here -- f is a directory
  
  return makeExecutable(f.listFiles());
}

代码示例来源:origin: eclipse-ee4j/glassfish

/**
   * @param args the command line arguments
   */
  public static void main(String args[])
  {
    System.out.println("os.version = "                  + System.getProperty("os.version"));
    System.out.println("os.name = "                     + System.getProperty("os.name"));
    System.out.println("os.arch = "                     + System.getProperty("os.arch"));
    System.out.println("isUNIX() returned: "            + isUNIX());
    System.out.println("isWindows() returned: "         + isWindows());
    System.out.println("isWindowsForSure() returned: "  + isWindowsForSure());
    System.out.println("isSun() returned: "             + isSun());
    System.out.println("isLinux() returned: "           + isLinux());
    System.out.println("isDebianLinux() returned: "     + isDebianLinux());
    System.out.println("isFedoraLinux() returned: "     + isFedoraLinux());
    System.out.println("isGentooLinux() returned: "     + isGentooLinux());
    System.out.println("isKnoppixLinux() returned: "    + isKnoppixLinux());
    System.out.println("isMandrakeLinux() returned: "   + isMandrakeLinux());
    System.out.println("isMandrivaLinux() returned: "   + isMandrivaLinux());
    System.out.println("isRedHatLinux() returned: "     + isRedHatLinux());
    System.out.println("isSlackwareLinux() returned: "  + isSlackwareLinux());
    System.out.println("isSuSELinux() returned: "       + isSuSELinux());
    System.out.println("isUbuntuLinux() returned: "     + isUbuntuLinux());
    System.out.println("isSunX86() returned: "          + isSunX86());
    System.out.println("isSunSparc() returned: "        + isSunSparc());
    System.out.println("isDarwin() returned: "          + isDarwin());
    System.out.println("isSolaris10() returned: "       + isSolaris10());
    System.out.println("isAix() returned: "             + isAix());
  }
}

代码示例来源:origin: org.glassfish.common/common-util

/**
   * @param args the command line arguments
   */
  public static void main(String args[])
  {
    System.out.println("os.version = "                  + System.getProperty("os.version"));
    System.out.println("os.name = "                     + System.getProperty("os.name"));
    System.out.println("os.arch = "                     + System.getProperty("os.arch"));
    System.out.println("isUNIX() returned: "            + isUNIX());
    System.out.println("isWindows() returned: "         + isWindows());
    System.out.println("isWindowsForSure() returned: "  + isWindowsForSure());
    System.out.println("isSun() returned: "             + isSun());
    System.out.println("isLinux() returned: "           + isLinux());
    System.out.println("isDebianLinux() returned: "     + isDebianLinux());
    System.out.println("isFedoraLinux() returned: "     + isFedoraLinux());
    System.out.println("isGentooLinux() returned: "     + isGentooLinux());
    System.out.println("isKnoppixLinux() returned: "    + isKnoppixLinux());
    System.out.println("isMandrakeLinux() returned: "   + isMandrakeLinux());
    System.out.println("isMandrivaLinux() returned: "   + isMandrivaLinux());
    System.out.println("isRedHatLinux() returned: "     + isRedHatLinux());
    System.out.println("isSlackwareLinux() returned: "  + isSlackwareLinux());
    System.out.println("isSuSELinux() returned: "       + isSuSELinux());
    System.out.println("isUbuntuLinux() returned: "     + isUbuntuLinux());
    System.out.println("isSunX86() returned: "          + isSunX86());
    System.out.println("isSunSparc() returned: "        + isSunSparc());
    System.out.println("isDarwin() returned: "          + isDarwin());
    System.out.println("isSolaris10() returned: "       + isSolaris10());
    System.out.println("isAix() returned: "             + isAix());
  }
}

代码示例来源:origin: org.glassfish.main.common/common-util

/**
   * @param args the command line arguments
   */
  public static void main(String args[])
  {
    System.out.println("os.version = "                  + System.getProperty("os.version"));
    System.out.println("os.name = "                     + System.getProperty("os.name"));
    System.out.println("os.arch = "                     + System.getProperty("os.arch"));
    System.out.println("isUNIX() returned: "            + isUNIX());
    System.out.println("isWindows() returned: "         + isWindows());
    System.out.println("isWindowsForSure() returned: "  + isWindowsForSure());
    System.out.println("isSun() returned: "             + isSun());
    System.out.println("isLinux() returned: "           + isLinux());
    System.out.println("isDebianLinux() returned: "     + isDebianLinux());
    System.out.println("isFedoraLinux() returned: "     + isFedoraLinux());
    System.out.println("isGentooLinux() returned: "     + isGentooLinux());
    System.out.println("isKnoppixLinux() returned: "    + isKnoppixLinux());
    System.out.println("isMandrakeLinux() returned: "   + isMandrakeLinux());
    System.out.println("isMandrivaLinux() returned: "   + isMandrivaLinux());
    System.out.println("isRedHatLinux() returned: "     + isRedHatLinux());
    System.out.println("isSlackwareLinux() returned: "  + isSlackwareLinux());
    System.out.println("isSuSELinux() returned: "       + isSuSELinux());
    System.out.println("isUbuntuLinux() returned: "     + isUbuntuLinux());
    System.out.println("isSunX86() returned: "          + isSunX86());
    System.out.println("isSunSparc() returned: "        + isSunSparc());
    System.out.println("isDarwin() returned: "          + isDarwin());
    System.out.println("isSolaris10() returned: "       + isSolaris10());
    System.out.println("isAix() returned: "             + isAix());
  }
}

相关文章