1 package org.javabb.infra; 2 3 4 5 import java.io.File ; 6 import java.io.FileInputStream ; 7 import java.io.FileNotFoundException ; 8 9 24 25 29 public class Configuration { 30 31 public static String realPath; 32 33 34 public static String showProperties = ""; 35 public String theme = ""; 36 public String domain = ""; 37 public String forumName = ""; 38 public String lang = ""; 39 public String dateFormat = ""; 40 public String timeFormat = ""; 41 public String buttonLang = ""; 42 public Integer topicsPage; 43 public Integer postsPage; 44 public String adminMail = ""; 45 public String smtpServerHost = ""; 46 public String smtpServerUserName = ""; 47 public String smtpServerUserPassword = ""; 48 49 public String emailNofityTopic = ""; 50 public String floodControl = ""; 51 public String forumAnnounceText = ""; 52 53 public Configuration() { 54 try { 55 String realPath = Configuration.realPath; 56 57 if (realPath != null) { 58 FileInputStream file = new FileInputStream (realPath + File.separator 59 +"WEB-INF"+ File.separator 60 +"appconf" + File.separator + "javabb.properties"); 61 62 MaintainProperties maintain = new MaintainProperties(file); 63 64 65 showProperties = maintain.getProperty("config.show.property"); 66 theme = maintain.getProperty("config.forum.theme"); 67 domain = maintain.getProperty("config.forum.domain"); 68 forumName = maintain.getProperty("config.forum.forum.name"); 69 lang = maintain.getProperty("config.forum.lang"); 70 dateFormat = maintain.getProperty("config.forum.date.format"); 71 timeFormat = maintain.getProperty("config.forum.time.format"); 72 buttonLang = maintain.getProperty("config.forum.button.lang"); 73 topicsPage = new Integer (maintain.getProperty("config.forum.topics.page")); 74 postsPage = new Integer (maintain.getProperty("config.forum.posts.page")); 75 smtpServerHost = maintain.getProperty("config.forum.smtp.server.host"); 76 smtpServerUserName = maintain.getProperty("config.forum.smtp.server.user"); 77 smtpServerUserPassword = maintain.getProperty("config.forum.smtp.server.senha"); 78 adminMail = maintain.getProperty("config.forum.admin.mail"); 79 emailNofityTopic = maintain.getProperty("config.email.notify.topic"); 80 floodControl = maintain.getProperty("config.forum.flood_control"); 81 forumAnnounceText = maintain.getProperty("config.forum.posts.announce.text"); 82 83 84 } 85 } catch (FileNotFoundException e) { 86 e.printStackTrace(); 87 } catch (Exception e) { 88 e.printStackTrace(); 89 } 90 } 91 92 93 94 95 99 public String getAdminMail() { 100 return adminMail; 101 } 102 105 public void setAdminMail(String adminMail) { 106 this.adminMail = adminMail; 107 } 108 111 public String getButtonLang() { 112 return buttonLang; 113 } 114 117 public void setButtonLang(String buttonLang) { 118 this.buttonLang = buttonLang; 119 } 120 123 public String getDateFormat() { 124 return dateFormat; 125 } 126 129 public void setDateFormat(String dateFormat) { 130 this.dateFormat = dateFormat; 131 } 132 135 public String getDomain() { 136 return domain; 137 } 138 141 public void setDomain(String domain) { 142 this.domain = domain; 143 } 144 147 public String getEmailNofityTopic() { 148 return emailNofityTopic; 149 } 150 153 public void setEmailNofityTopic(String emailNofityTopic) { 154 this.emailNofityTopic = emailNofityTopic; 155 } 156 159 public String getForumName() { 160 return forumName; 161 } 162 165 public void setForumName(String forumName) { 166 this.forumName = forumName; 167 } 168 171 public String getLang() { 172 return lang; 173 } 174 177 public void setLang(String lang) { 178 this.lang = lang; 179 } 180 183 public Integer getPostsPage() { 184 return postsPage; 185 } 186 189 public void setPostsPage(Integer postsPage) { 190 this.postsPage = postsPage; 191 } 192 195 public String getSmtpServerHost() { 196 return smtpServerHost; 197 } 198 201 public void setSmtpServerHost(String smtpServerHost) { 202 this.smtpServerHost = smtpServerHost; 203 } 204 207 public String getSmtpServerUserName() { 208 return smtpServerUserName; 209 } 210 213 public void setSmtpServerUserName(String smtpServerUserName) { 214 this.smtpServerUserName = smtpServerUserName; 215 } 216 219 public String getSmtpServerUserPassword() { 220 return smtpServerUserPassword; 221 } 222 225 public void setSmtpServerUserPassword(String smtpServerUserPassword) { 226 this.smtpServerUserPassword = smtpServerUserPassword; 227 } 228 231 public String getTheme() { 232 return theme; 233 } 234 237 public void setTheme(String theme) { 238 this.theme = theme; 239 } 240 243 public String getTimeFormat() { 244 return timeFormat; 245 } 246 249 public void setTimeFormat(String timeFormat) { 250 this.timeFormat = timeFormat; 251 } 252 255 public Integer getTopicsPage() { 256 return topicsPage; 257 } 258 261 public void setTopicsPage(Integer topicsPage) { 262 this.topicsPage = topicsPage; 263 } 264 } | Popular Tags |