1 package org.apache.turbine.services.resources; 2 3 18 19 import java.util.Iterator ; 20 import java.util.List ; 21 22 import org.apache.commons.configuration.Configuration; 23 24 import org.apache.turbine.Turbine; 25 import org.apache.turbine.TurbineConstants; 26 import org.apache.turbine.services.security.SecurityService; 27 28 40 public abstract class TurbineResources 41 { 42 43 public static final String MAIL_SERVER_KEY = TurbineConstants.MAIL_SERVER_KEY; 44 45 46 public static final String MODULE_CACHE_KEY = TurbineConstants.MODULE_CACHE_KEY; 47 48 49 public static final String MODULE_PACKAGES_KEY = TurbineConstants.MODULE_PACKAGES; 50 51 52 public static final String ACTION_CACHE_SIZE_KEY = TurbineConstants.ACTION_CACHE_SIZE_KEY; 53 54 55 public static final String LAYOUT_CACHE_SIZE_KEY = TurbineConstants.LAYOUT_CACHE_SIZE_KEY; 56 57 58 public static final String NAVIGATION_CACHE_SIZE_KEY = TurbineConstants.NAVIGATION_CACHE_SIZE_KEY; 59 60 61 public static final String PAGE_CACHE_SIZE_KEY = TurbineConstants.PAGE_CACHE_SIZE_KEY; 62 63 64 public static final String SCREEN_CACHE_SIZE_KEY = TurbineConstants.SCREEN_CACHE_SIZE_KEY; 65 66 67 public static final String USER_CLASS_KEY = SecurityService.USER_CLASS_KEY; 68 69 70 public static final String MAX_FILE_SIZE_KEY = "max.file.size.bytes"; 71 72 73 public static final String FILE_SERVER = "file.server"; 74 75 76 public static final String LOGIN_MESSAGE = TurbineConstants.LOGIN_MESSAGE; 77 78 79 public static final String LOGIN_ERROR = TurbineConstants.LOGIN_ERROR; 80 81 82 public static final String LOGIN_MESSAGE_NOSCREEN = TurbineConstants.LOGIN_MESSAGE_NOSCREEN; 83 84 85 public static final String LOGOUT_MESSAGE = TurbineConstants.LOGOUT_MESSAGE; 86 87 93 public static void setProperty(String key, String value) 94 { 95 Turbine.getConfiguration().setProperty(key, value); 96 } 97 98 105 public static boolean getBoolean(String name) 106 { 107 return Turbine.getConfiguration().getBoolean(name); 108 } 109 110 119 public static boolean getBoolean(String name, 120 boolean def) 121 { 122 return Turbine.getConfiguration().getBoolean(name, def); 123 } 124 125 132 public static double getDouble(String name) 133 { 134 return Turbine.getConfiguration().getDouble(name); 135 } 136 137 145 public static double getDouble(String name, 146 double def) 147 { 148 return Turbine.getConfiguration().getDouble(name, def); 149 } 150 151 158 public static float getFloat(String name) 159 { 160 return Turbine.getConfiguration().getFloat(name); 161 } 162 163 171 public static float getFloat(String name, 172 float def) 173 { 174 return Turbine.getConfiguration().getFloat(name, def); 175 } 176 177 184 public static int getInt(String name) 185 { 186 return Turbine.getConfiguration().getInt(name); 187 } 188 189 197 public static int getInt(String name, 198 int def) 199 { 200 return Turbine.getConfiguration().getInt(name, def); 201 } 202 203 209 public static Iterator getKeys() 210 { 211 return Turbine.getConfiguration().getKeys(); 212 } 213 214 221 public static Iterator getKeys(String prefix) 222 { 223 return Turbine.getConfiguration().getKeys(prefix); 224 } 225 226 233 public static long getLong(String name) 234 { 235 return Turbine.getConfiguration().getLong(name); 236 } 237 238 246 public static long getLong(String name, 247 long def) 248 { 249 return Turbine.getConfiguration().getLong(name, def); 250 } 251 252 259 public static String getString(String name) 260 { 261 return Turbine.getConfiguration().getString(name); 262 } 263 264 272 public static String getString(String name, 273 String def) 274 { 275 return Turbine.getConfiguration().getString(name, def); 276 } 277 278 285 public static String [] getStringArray(String name) 286 { 287 return Turbine.getConfiguration().getStringArray(name); 288 } 289 290 297 public static List getList(String name) 298 { 299 return Turbine.getConfiguration().getList(name); 300 } 301 302 310 public static List getList(String name, 311 List def) 312 { 313 return Turbine.getConfiguration().getList(name, def); 314 } 315 316 321 public static Configuration getConfiguration() 322 { 323 return Turbine.getConfiguration(); 324 } 325 326 333 public static Configuration getConfiguration(String prefix) 334 { 335 return Turbine.getConfiguration().subset(prefix); 336 } 337 } 338 | Popular Tags |