%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
org.apache.jetspeed.container.ContainerInfo |
|
|
1 | /* |
|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
|
3 | * contributor license agreements. See the NOTICE file distributed with |
|
4 | * this work for additional information regarding copyright ownership. |
|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
|
6 | * (the "License"); you may not use this file except in compliance with |
|
7 | * the License. You may obtain a copy of the License at |
|
8 | * |
|
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
10 | * |
|
11 | * Unless required by applicable law or agreed to in writing, software |
|
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 | * See the License for the specific language governing permissions and |
|
15 | * limitations under the License. |
|
16 | */ |
|
17 | package org.apache.jetspeed.container; |
|
18 | ||
19 | import java.util.ResourceBundle; |
|
20 | ||
21 | /** |
|
22 | * Container Information |
|
23 | * |
|
24 | * @author <a href="mailto:shinsuke@yahoo.co.jp">Shinsuke Sugaya</a> |
|
25 | */ |
|
26 | 0 | public final class ContainerInfo |
27 | { |
|
28 | public static final ResourceBundle CONTAINER_INFO; |
|
29 | ||
30 | static |
|
31 | { |
|
32 | 0 | CONTAINER_INFO = ResourceBundle.getBundle("org.apache.jetspeed.container.resources.ContainerInfo"); |
33 | 0 | } |
34 | ||
35 | public static final String getPortletContainerName() |
|
36 | { |
|
37 | 0 | return CONTAINER_INFO.getString("jetspeed.container.name"); |
38 | } |
|
39 | ||
40 | public static final String getPortletContainerMajorVersion() |
|
41 | { |
|
42 | 0 | return CONTAINER_INFO.getString("jetspeed.container.version.major"); |
43 | } |
|
44 | ||
45 | public static final String getPortletContainerMinorVersion() |
|
46 | { |
|
47 | 0 | return CONTAINER_INFO.getString("jetspeed.container.version.minor"); |
48 | } |
|
49 | ||
50 | public static final int getMajorSpecificationVersion() |
|
51 | { |
|
52 | 0 | return Integer.parseInt(CONTAINER_INFO.getString("javax.portlet.version.major")); |
53 | } |
|
54 | ||
55 | public static final int getMinorSpecificationVersion() |
|
56 | { |
|
57 | 0 | return Integer.parseInt(CONTAINER_INFO.getString("javax.portlet.version.minor")); |
58 | } |
|
59 | ||
60 | public static final String getServerInfo() |
|
61 | { |
|
62 | 0 | StringBuffer sb = new StringBuffer(getPortletContainerName()).append( |
63 | CONTAINER_INFO.getString("jetspeed.container.separator")).append(getPortletContainerMajorVersion()) |
|
64 | .append(".").append(getPortletContainerMinorVersion()); |
|
65 | 0 | return sb.toString(); |
66 | } |
|
67 | ||
68 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |