01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: public final class ContainerInfo {
27: public static final ResourceBundle CONTAINER_INFO;
28:
29: static {
30: CONTAINER_INFO = ResourceBundle
31: .getBundle("org.apache.jetspeed.container.resources.ContainerInfo");
32: }
33:
34: public static final String getPortletContainerName() {
35: return CONTAINER_INFO.getString("jetspeed.container.name");
36: }
37:
38: public static final String getPortletContainerMajorVersion() {
39: return CONTAINER_INFO
40: .getString("jetspeed.container.version.major");
41: }
42:
43: public static final String getPortletContainerMinorVersion() {
44: return CONTAINER_INFO
45: .getString("jetspeed.container.version.minor");
46: }
47:
48: public static final int getMajorSpecificationVersion() {
49: return Integer.parseInt(CONTAINER_INFO
50: .getString("javax.portlet.version.major"));
51: }
52:
53: public static final int getMinorSpecificationVersion() {
54: return Integer.parseInt(CONTAINER_INFO
55: .getString("javax.portlet.version.minor"));
56: }
57:
58: public static final String getServerInfo() {
59: StringBuffer sb = new StringBuffer(getPortletContainerName())
60: .append(
61: CONTAINER_INFO
62: .getString("jetspeed.container.separator"))
63: .append(getPortletContainerMajorVersion()).append(".")
64: .append(getPortletContainerMinorVersion());
65: return sb.toString();
66: }
67:
68: }
|