1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.util;
24  
25  import java.text.DateFormat;
26  
27  import java.util.Date;
28  
29  /**
30   * <a href="ReleaseInfo.java.html"><b><i>View Source</i></b></a>
31   *
32   * @author Brian Wing Shun Chan
33   */
34  public class ReleaseInfo {
35  
36      static String name = "Liferay Portal Enterprise Edition";
37  
38      static String version = "5.1.7";
39  
40      static String versionDisplayName = "5.1 EE SP4";
41  
42      static String codeName = "Calvin";
43  
44      static String build = "5107";
45  
46      static String date = "October 22, 2009";
47  
48      static String releaseInfoPrefix = System.getProperty(
49          "liferay.release.info.prefix" , StringPool.BLANK);
50  
51      static String releaseInfoSuffix = System.getProperty(
52          "liferay.release.info.suffix" , StringPool.BLANK);
53  
54      static String releaseInfo =
55          releaseInfoPrefix + name + " " + versionDisplayName + " (" + codeName +
56              " / Build " + build + " / " + date + ")" + releaseInfoSuffix;
57  
58      static String serverInfo = name + " / " + version;
59  
60      public static int RELEASE_4_2_0_BUILD_NUMBER = 3500;
61  
62      public static int RELEASE_4_2_1_BUILD_NUMBER = 3501;
63  
64      public static int RELEASE_4_2_2_BUILD_NUMBER = 3502;
65  
66      public static int RELEASE_4_3_0_BUILD_NUMBER = 4300;
67  
68      public static int RELEASE_4_3_1_BUILD_NUMBER = 4301;
69  
70      public static int RELEASE_4_3_2_BUILD_NUMBER = 4302;
71  
72      public static int RELEASE_4_3_3_BUILD_NUMBER = 4303;
73  
74      public static int RELEASE_4_3_4_BUILD_NUMBER = 4304;
75  
76      public static int RELEASE_4_3_5_BUILD_NUMBER = 4305;
77  
78      public static int RELEASE_4_3_6_BUILD_NUMBER = 4306;
79  
80      public static int RELEASE_4_4_0_BUILD_NUMBER = 4400;
81  
82      public static int RELEASE_5_0_0_BUILD_NUMBER = 5000;
83  
84      public static int RELEASE_5_0_1_BUILD_NUMBER = 5001;
85  
86      public static int RELEASE_5_1_0_BUILD_NUMBER = 5100;
87  
88      public static int RELEASE_5_1_1_BUILD_NUMBER = 5101;
89  
90      public static int RELEASE_5_1_2_BUILD_NUMBER = 5102;
91  
92      public static int RELEASE_5_1_3_BUILD_NUMBER = 5103;
93  
94      public static int RELEASE_5_1_4_BUILD_NUMBER = 5104;
95  
96      public static int RELEASE_5_1_5_BUILD_NUMBER = 5105;
97  
98      public static int RELEASE_5_1_6_BUILD_NUMBER = 5106;
99  
100     public static int RELEASE_5_1_7_BUILD_NUMBER = 5107;
101 
102     public static final String getVersion() {
103         return version;
104     }
105 
106     public static final String getCodeName() {
107         return codeName;
108     }
109 
110     public static final int getBuildNumber() {
111         return Integer.parseInt(build);
112     }
113 
114     public static final Date getBuildDate() {
115         DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
116 
117         return GetterUtil.getDate(date, df);
118     }
119 
120     public static final String getReleaseInfo() {
121         return releaseInfo;
122     }
123 
124     public static final String getServerInfo() {
125         return serverInfo;
126     }
127 
128 }