1 64 65 package com.jcorporate.expresso.core.misc; 66 67 import java.util.HashMap ; 68 import java.util.Vector ; 69 70 71 75 public class ConfigExpresso { 76 79 private String logDirectory = "%web-app%WEB-INF/log"; 80 81 84 private String strongCrypto = "n"; 85 86 89 private String servletAPI = "2_3"; 90 91 94 private Vector contexts = new Vector (); 95 96 99 private ConfigCacheManager myCache = null; 100 101 104 private String cryptoKey = null; 105 106 109 private String encryptMode = null; 110 111 114 private static HashMap classHandlers = new HashMap (); 115 116 120 private String httpPort = "80"; 121 122 125 private String sslPort = "443"; 126 127 public ConfigExpresso() { 128 } 129 130 public void setCryptoKey(String newKey) { 131 cryptoKey = newKey; 132 } 133 134 public void setEncryptMode(String newMode) { 135 encryptMode = newMode; 136 } 137 138 public void setHttpPort(String newValue) { 139 httpPort = newValue; 140 } 141 142 public void setSslPort(String newValue) { 143 sslPort = newValue; 144 } 145 146 public String getEncryptMode() { 147 return encryptMode; 148 } 149 150 public String getCryptoKey() { 151 return cryptoKey; 152 } 153 154 public String getHttpPort() { 155 return httpPort; 156 } 157 158 public String getSslPort() { 159 return sslPort; 160 } 161 162 public void addCacheManager(ConfigCacheManager newCache) { 163 myCache = newCache; 164 } 165 166 public static void addClassHandler(ConfigClassHandler cch) { 167 classHandlers.put(cch.getName(), cch); 168 } 169 170 public ConfigCacheManager getCacheManager() { 171 return myCache; 172 } 173 174 public Vector getContexts() { 175 return contexts; 176 } 177 178 public HashMap getClassHandlers() { 182 return classHandlers; 183 } 184 185 public void addContext(ConfigContext newContext) { 186 contexts.addElement(newContext); 187 } 188 189 public void setLogDirectory(String newDir) { 190 StringUtil.assertNotBlank(newDir, 191 "You must specify a non-blank log directory"); 192 logDirectory = newDir; 193 } 194 195 public String getLogDirectory() { 196 return ConfigManager.expandValue(logDirectory); 197 } 198 199 public void setStrongCrypto(String newCrypto) { 200 StringUtil.assertBoolean(newCrypto, 201 "You must specify a boolean value for the strong encryption flag"); 202 strongCrypto = newCrypto; 203 } 204 205 public boolean strongCrypto() { 206 return StringUtil.toBoolean(strongCrypto); 207 } 208 209 public void setServletAPI(String newAPI) { 210 servletAPI = newAPI; 211 } 212 213 public void setServletApi(String newAPI) { 214 servletAPI = newAPI; 215 } 216 217 public String getServletAPI() { 218 return servletAPI; 219 } 220 } | Popular Tags |