2 * Copyright 2004 The Apache Software Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Lucene
.Net
.Util
22 /// <summary> Some useful constants.
25 /// <author> Doug Cutting
27 /// <version> $Id: Constants.cs,v 1.3 2006/10/02 17:09:10 joeshaw Exp $
31 public sealed class Constants
37 /// <summary>The value of <tt>System.getProperty("java.version")<tt>. *</summary>
38 public static readonly System
.String JAVA_VERSION
= System
.Configuration
.ConfigurationSettings
.AppSettings
.Get("java.version"); // {{Aroush-1.9}}
39 /// <summary>True iff this is Java version 1.1. </summary>
40 public static readonly bool JAVA_1_1
= JAVA_VERSION
.StartsWith("1.1.");
41 /// <summary>True iff this is Java version 1.2. </summary>
42 public static readonly bool JAVA_1_2
= JAVA_VERSION
.StartsWith("1.2.");
43 /// <summary>True iff this is Java version 1.3. </summary>
44 public static readonly bool JAVA_1_3
= JAVA_VERSION
.StartsWith("1.3.");
46 /// <summary>The value of <tt>System.getProperty("os.name")<tt>. *</summary>
47 public static readonly System
.String OS_NAME
= System
.Environment
.GetEnvironmentVariable("OS");
48 /// <summary>True iff running on Linux. </summary>
49 public static readonly bool LINUX
= OS_NAME
.StartsWith("Linux");
50 /// <summary>True iff running on Windows. </summary>
51 public static readonly bool WINDOWS
= OS_NAME
.StartsWith("Windows");
52 /// <summary>True iff running on SunOS. </summary>
53 public static readonly bool SUN_OS
= OS_NAME
.StartsWith("SunOS");