1 16 package org.apache.pluto; 17 18 import java.util.ResourceBundle ; 19 20 23 public final class Environment { 24 25 public static final ResourceBundle PROPS; 26 27 static { 28 PROPS = ResourceBundle.getBundle("org.apache.pluto.environment"); 29 } 30 31 32 public static final String getPortletContainerName() { 33 return PROPS.getString("pluto.container.name"); 34 } 35 36 public static final String getPortletContainerMajorVersion() { 37 return PROPS.getString("pluto.container.version.major"); 38 } 39 40 public static final String getPortletContainerMinorVersion() { 41 return PROPS.getString("pluto.container.version.minor"); 42 } 43 44 public static final int getMajorSpecificationVersion() { 45 return Integer.parseInt(PROPS.getString("javax.portlet.version.major")); 46 } 47 48 public static final int getMinorSpecificationVersion() { 49 return Integer.parseInt(PROPS.getString("javax.portlet.version.minor")); 50 } 51 52 public static final String getServerInfo() { 53 StringBuffer sb = new StringBuffer (getPortletContainerName()) 54 .append("/") 55 .append(getPortletContainerMajorVersion()) 56 .append(".") 57 .append(getPortletContainerMinorVersion()); 58 return sb.toString(); 59 } 60 61 } 62 | Popular Tags |