当前位置: 首页>>代码示例>>Java>>正文


Java SystemUtils.IS_OS_MAC属性代码示例

本文整理汇总了Java中org.apache.commons.lang.SystemUtils.IS_OS_MAC属性的典型用法代码示例。如果您正苦于以下问题:Java SystemUtils.IS_OS_MAC属性的具体用法?Java SystemUtils.IS_OS_MAC怎么用?Java SystemUtils.IS_OS_MAC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.lang.SystemUtils的用法示例。


在下文中一共展示了SystemUtils.IS_OS_MAC属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDefaultEthDevice

public static String getDefaultEthDevice() {
    if (SystemUtils.IS_OS_MAC) {
        final String defDev = Script.runSimpleBashScript("/sbin/route -n get default 2> /dev/null | grep interface | awk '{print $2}'");
        return defDev;
    }
    final String defaultRoute = Script.runSimpleBashScript("/sbin/route | grep default");

    if (defaultRoute == null) {
        return null;
    }

    final String[] defaultRouteList = defaultRoute.split("\\s+");

    if (defaultRouteList.length != 8) {
        return null;
    }

    return defaultRouteList[7];
}
 
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:19,代码来源:NetUtils.java

示例2: getPhantomLocation

/**
 * The location of the phantom js is different for different os types. The
 * method returns the appropriate binary corresponding to the os. Currently
 * only Windows, Mac OS and Linux are supported.
 *
 * @return The location of the phantom js
 */
private static String getPhantomLocation() {
    String phantomLocation;
    String reportDirectory = ExportUtils.getReportDirectory() + File.separator;
    if (SystemUtils.IS_OS_WINDOWS) {
        phantomLocation = reportDirectory + "windows_phantomjs.exe";
    } else if (SystemUtils.IS_OS_MAC) {
        phantomLocation = reportDirectory + "macosx_phantomjs";
    } else if (SystemUtils.IS_OS_LINUX) {
        phantomLocation = reportDirectory + "linux_phantomjs";
    } else {
        logger.error("phantomLocation is null. Check phantomjs binary is present or not");
        throw new EfwException("PhantomJs Location is null. Can't process request.");
    }

    File file = new File(phantomLocation);
    phantomLocation = file.getAbsolutePath();
    return phantomLocation;
}
 
开发者ID:helicalinsight,项目名称:helicalinsight,代码行数:25,代码来源:ReportsProcessor.java

示例3: initializeLibraryPath

public static void initializeLibraryPath() throws Exception {
    File theJava3DFile = new File("java3d");
    File theJava3DLibraryFile = null;
    if (SystemUtils.IS_OS_WINDOWS) {
        if (VM_32_BIT) {
            theJava3DLibraryFile =  new File(theJava3DFile, "win32");
        } else {
            theJava3DLibraryFile =  new File(theJava3DFile, "win64");
        }
    }
    if (SystemUtils.IS_OS_LINUX) {
        if (VM_32_BIT) {
            theJava3DLibraryFile =  new File(theJava3DFile, "linux32");
        } else {
            theJava3DLibraryFile =  new File(theJava3DFile, "linux64");
        }
    }
    if (SystemUtils.IS_OS_MAC) {
        theJava3DLibraryFile =  new File(theJava3DFile, "macos-universal");
    }
    if (theJava3DLibraryFile != null) {
        addLibraryPath(theJava3DLibraryFile.getAbsolutePath());
    }
}
 
开发者ID:mirkosertic,项目名称:ERDesignerNG,代码行数:24,代码来源:Java3DUtils.java

示例4: getServerIpNoCache

private static String getServerIpNoCache() {
	if (SystemUtils.IS_OS_WINDOWS) {
		return "127.0.0.1";
	}
	else if (SystemUtils.IS_OS_MAC) {
		return "127.0.0.1";
	}
	else if (SystemUtils.IS_OS_LINUX) {
		try {
			NetworkInterface networkInterface = NetworkInterface.getByName("eth0");
			if (networkInterface == null) {
				networkInterface = NetworkInterface.getByName("eth1");
				if (networkInterface == null) {
					throw new NullPointerException("网卡eth0和eth1都找不到,没办法获取到IP.");
				}
			}
			return getServerIp(networkInterface);
		}
		catch (SocketException e) {
			throw new RuntimeException(e.getMessage(), e);
		}
	}
	else {
		throw new RuntimeException("未知操作系统.");
	}

}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:27,代码来源:ServerIpUtil.java

示例5: getDir

@Override
public String getDir() {
	// TODO ubuntu桌面环境判断
	if (SystemUtils.IS_OS_MAC) {
		return System.getProperty("user.home") + "/log/resin";
	}

	return "/log/resin";
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:9,代码来源:LogDirLeiImpl.java

示例6: LibraryLoader

public LibraryLoader() {
	tmpdir = System.getProperty("java.io.tmpdir");
	fLibsFolder = "OCR";
	vSysArch = System.getProperty("sikuli.arch");
    if (null == vSysArch) {
      vSysArch = System.getProperty("os.arch");
    }
    
    if (vSysArch.contains("64")) {
    	vSysArch = "x86"; 
    } else {
    	vSysArch = "x86";
    }
    
	if (SystemUtils.IS_OS_WINDOWS) {
		neededLibs = new String[] {"libtesseract-3.dll", "jnitesseract.dll"};
		os = "windows";
	} else if (SystemUtils.IS_OS_MAC) {
		neededLibs = new String[] {"libtesseract.3.dylib", "libjnitesseract.dylib"};
		os = "macosx";
	} else if (SystemUtils.IS_OS_LINUX) {
		neededLibs = new String[] {"libtesseract.so.3", "libjnitesseract.so"};
		os = "linux";
	}
	
	this.extractDllFromJar();
}
 
开发者ID:Hi-Fi,项目名称:remotesikulilibrary,代码行数:27,代码来源:LibraryLoader.java

示例7: getDirInAppData

public static @Nullable String getDirInAppData(String dir) {
  if (SystemUtils.IS_OS_WINDOWS) {
    return System.getenv("APPDATA") + "/." + dir;
  } else if (SystemUtils.IS_OS_MAC) {
    return SystemUtils.USER_HOME + "/Library/Application Support/" + dir;
  } else if (SystemUtils.IS_OS_UNIX) {
    return SystemUtils.USER_HOME + "/." + dir;
  }
  return null;
}
 
开发者ID:Adrodoc55,项目名称:MPL,代码行数:10,代码来源:CommonDirectories.java

示例8: createTempDirectory

private File createTempDirectory() {
    try {
        if (SystemUtils.IS_OS_MAC) {
            return Files.createTempDirectory(Paths.get(OS_MAC_TMP_DIR), TESTCONTAINERS_TMP_DIR_PREFIX).toFile();
        }
        return Files.createTempDirectory(TESTCONTAINERS_TMP_DIR_PREFIX).toFile();
    } catch  (IOException e) {
        return new File(TESTCONTAINERS_TMP_DIR_PREFIX + Base58.randomString(5));
    }
}
 
开发者ID:testcontainers,项目名称:testcontainers-java,代码行数:10,代码来源:MountableFile.java

示例9: createDataSource

protected BeanDefinition createDataSource(String dataSourceId, Element element, ParserContext parserContext) {

		final String host = element.getAttribute("host");
		final String database = element.getAttribute("database");
		final String user = element.getAttribute("user");
		final String password = element.getAttribute("password");

		final String maxPoolSize = element.getAttribute("maxPoolSize");
		final String driverClass = element.getAttribute("driverClass");
		final String port = element.getAttribute("port");

		int idleConnectionTestPeriod = 0;
		if (EnvUtil.isDevEnv() && (SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_MAC)) {
			idleConnectionTestPeriod = 60;// 间隔60秒检查空闲连接
		}

		BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(DataSourceManager.getJdbcDataSource());

		builder.addPropertyValue("host", host);
		builder.addPropertyValue("database", database);
		builder.addPropertyValue("user", user);
		builder.addPropertyValue("password", password);
		builder.addPropertyValue("driverClass", driverClass);
		if (StringUtils.isNotEmpty(port)) {
			builder.addPropertyValue("port", port);
		}
		if (StringUtils.isNotEmpty(maxPoolSize)) {
			builder.addPropertyValue("maxPoolSize", maxPoolSize);
		}
		builder.addPropertyValue("idleConnectionTestPeriod", idleConnectionTestPeriod);

		builder.setInitMethodName("init");
		builder.setDestroyMethodName("destroy");

		builder.setScope(BeanDefinition.SCOPE_SINGLETON);
		builder.setLazyInit(true);
		// builder.setInitMethodName("init");
		// builder.setDestroyMethodName("destroy");

		return RegisterComponentUtil.registerComponent(parserContext, builder, dataSourceId);
	}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:41,代码来源:JdbcBeanDefinitionParser.java

示例10: isEnabled

@Override
public boolean isEnabled() {
	return SystemUtils.IS_OS_MAC;
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:4,代码来源:EnvLeiMacImpl.java

示例11: MindMapPanelConfig

public MindMapPanelConfig() {
  if (SystemUtils.IS_OS_MAC) {
    // key map for MAC
    this.mapShortCut.put(KEY_ADD_CHILD_AND_START_EDIT, new KeyShortcut(KEY_ADD_CHILD_AND_START_EDIT, KeyEvent.VK_TAB, 0));
    this.mapShortCut.put(KEY_ADD_SIBLING_AND_START_EDIT, new KeyShortcut(KEY_ADD_SIBLING_AND_START_EDIT, KeyEvent.VK_ENTER, 0));
    this.mapShortCut.put(KEY_CANCEL_EDIT, new KeyShortcut(KEY_CANCEL_EDIT, KeyEvent.VK_ESCAPE, 0));
    this.mapShortCut.put(KEY_TOPIC_FOLD, new KeyShortcut(KEY_TOPIC_FOLD, KeyEvent.VK_MINUS, 0));
    this.mapShortCut.put(KEY_TOPIC_UNFOLD, new KeyShortcut(KEY_TOPIC_UNFOLD, KeyEvent.VK_EQUALS, 0));
    this.mapShortCut.put(KEY_FOCUS_ROOT_OR_START_EDIT, new KeyShortcut(KEY_FOCUS_ROOT_OR_START_EDIT, KeyEvent.VK_SPACE, KeyEvent.ALT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_DOWN, new KeyShortcut(KEY_FOCUS_MOVE_DOWN, KeyEvent.VK_DOWN, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_UP, new KeyShortcut(KEY_FOCUS_MOVE_UP, KeyEvent.VK_UP, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_LEFT, new KeyShortcut(KEY_FOCUS_MOVE_LEFT, KeyEvent.VK_LEFT, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_RIGHT, new KeyShortcut(KEY_FOCUS_MOVE_RIGHT, KeyEvent.VK_RIGHT, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_DOWN_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_DOWN_ADD_FOCUSED, KeyEvent.VK_DOWN, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_UP_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_UP_ADD_FOCUSED, KeyEvent.VK_UP, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_LEFT_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_LEFT_ADD_FOCUSED, KeyEvent.VK_LEFT, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_RIGHT_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_RIGHT_ADD_FOCUSED, KeyEvent.VK_RIGHT, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_DELETE_TOPIC, new KeyShortcut(KEY_DELETE_TOPIC, KeyEvent.VK_DELETE, 0));
    this.mapShortCut.put(KEY_TOPIC_TEXT_NEXT_LINE, new KeyShortcut(KEY_TOPIC_TEXT_NEXT_LINE, KeyEvent.VK_ENTER, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_ZOOM_IN, new KeyShortcut(KEY_ZOOM_IN, KeyEvent.VK_PLUS, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_ZOOM_OUT, new KeyShortcut(KEY_ZOOM_OUT, KeyEvent.VK_MINUS, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_ZOOM_RESET, new KeyShortcut(KEY_ZOOM_RESET, KeyEvent.VK_0, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_SHOW_POPUP, new KeyShortcut(KEY_SHOW_POPUP, KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK));
  } else {
    // key map for Linux and Windows
    this.mapShortCut.put(KEY_ADD_CHILD_AND_START_EDIT, new KeyShortcut(KEY_ADD_CHILD_AND_START_EDIT, KeyEvent.VK_TAB, 0));
    this.mapShortCut.put(KEY_ADD_SIBLING_AND_START_EDIT, new KeyShortcut(KEY_ADD_SIBLING_AND_START_EDIT, KeyEvent.VK_ENTER, 0));
    this.mapShortCut.put(KEY_CANCEL_EDIT, new KeyShortcut(KEY_CANCEL_EDIT, KeyEvent.VK_ESCAPE, 0));
    this.mapShortCut.put(KEY_TOPIC_FOLD, new KeyShortcut(KEY_TOPIC_FOLD, KeyEvent.VK_MINUS, 0));
    this.mapShortCut.put(KEY_TOPIC_UNFOLD, new KeyShortcut(KEY_TOPIC_UNFOLD, KeyEvent.VK_EQUALS, 0));
    this.mapShortCut.put(KEY_FOCUS_ROOT_OR_START_EDIT, new KeyShortcut(KEY_FOCUS_ROOT_OR_START_EDIT, KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_DOWN, new KeyShortcut(KEY_FOCUS_MOVE_DOWN, KeyEvent.VK_DOWN, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_UP, new KeyShortcut(KEY_FOCUS_MOVE_UP, KeyEvent.VK_UP, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_LEFT, new KeyShortcut(KEY_FOCUS_MOVE_LEFT, KeyEvent.VK_LEFT, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_RIGHT, new KeyShortcut(KEY_FOCUS_MOVE_RIGHT, KeyEvent.VK_RIGHT, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_DOWN_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_DOWN_ADD_FOCUSED, KeyEvent.VK_DOWN, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_UP_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_UP_ADD_FOCUSED, KeyEvent.VK_UP, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_LEFT_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_LEFT_ADD_FOCUSED, KeyEvent.VK_LEFT, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_RIGHT_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_RIGHT_ADD_FOCUSED, KeyEvent.VK_RIGHT, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_DELETE_TOPIC, new KeyShortcut(KEY_DELETE_TOPIC, KeyEvent.VK_DELETE, 0));
    this.mapShortCut.put(KEY_TOPIC_TEXT_NEXT_LINE, new KeyShortcut(KEY_TOPIC_TEXT_NEXT_LINE, KeyEvent.VK_ENTER, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_ZOOM_IN, new KeyShortcut(KEY_ZOOM_IN, KeyEvent.VK_PLUS, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_ZOOM_OUT, new KeyShortcut(KEY_ZOOM_OUT, KeyEvent.VK_MINUS, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_ZOOM_RESET, new KeyShortcut(KEY_ZOOM_RESET, KeyEvent.VK_0, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_SHOW_POPUP, new KeyShortcut(KEY_SHOW_POPUP, KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK));
  }
}
 
开发者ID:raydac,项目名称:netbeans-mmd-plugin,代码行数:47,代码来源:MindMapPanelConfig.java


注:本文中的org.apache.commons.lang.SystemUtils.IS_OS_MAC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。