/logback-1.0.6/logback-core/src/main/java/ch/qos/logback/core/util/EnvUtil.java
Java | 49 lines | 27 code | 6 blank | 16 comment | 5 complexity | 9f7b71270fc8b5839b0862d92363ac4d MD5 | raw file
- /**
- * Logback: the reliable, generic, fast and flexible logging framework.
- * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
- *
- * This program and the accompanying materials are dual-licensed under
- * either the terms of the Eclipse Public License v1.0 as published by
- * the Eclipse Foundation
- *
- * or (per the licensee's choosing)
- *
- * under the terms of the GNU Lesser General Public License version 2.1
- * as published by the Free Software Foundation.
- */
- package ch.qos.logback.core.util;
-
- /**
- * @author Ceki Gücü
- */
- public class EnvUtil {
-
-
- static public boolean isJDK5() {
- String javaVersion = System.getProperty("java.version");
- if (javaVersion == null) {
- return false;
- }
- if (javaVersion.startsWith("1.5")) {
- return true;
- } else {
- return false;
- }
- }
-
- static public boolean isJaninoAvailable() {
- ClassLoader classLoader = EnvUtil.class.getClassLoader();
- try {
- Class bindingClass = classLoader.loadClass("org.codehaus.janino.ScriptEvaluator");
- return (bindingClass != null);
- } catch (ClassNotFoundException e) {
- return false;
- }
- }
-
- public static boolean isWindows() {
- String os = System.getProperty("os.name");
- return os.startsWith("Windows");
- }
-
- }