1   /**
2    * Logback: the generic, reliable, fast and flexible logging framework.
3    * 
4    * Copyright (C) 2000-2008, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  package ch.qos.logback.core.testUtil;
11  
12  public class Env {
13  
14    static public boolean isWindows() {
15      return System.getProperty("os.name").indexOf("Windows") != -1;
16    }
17  
18    static public boolean isLinux() {
19      return System.getProperty("os.name").indexOf("Linux") != -1;
20    }
21  
22    static public boolean isJDK6OrHigher() {
23      String javaVersion = System.getProperty("java.version");
24      if (javaVersion == null) {
25        return false;
26      }
27      if (javaVersion.startsWith("1.6") || javaVersion.startsWith("1.7")) {
28        return true;
29      } else {
30        return false;
31      }
32    }
33  
34  }