Changeset 6412 for vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/VloWicketApplication.java
- Timestamp:
- 08/04/15 11:46:13 (9 years ago)
- Location:
- vlo/branches/vlo-3.3-oeaw
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.3-oeaw
- Property svn:mergeinfo changed
/vlo/trunk merged: 6318-6320,6327-6334,6337-6348,6353,6356,6358,6362-6363,6372,6384,6387,6389-6390,6394,6402,6404-6411
- Property svn:mergeinfo changed
-
vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/VloWicketApplication.java
r6350 r6412 14 14 import eu.clarin.cmdi.vlo.wicket.pages.VloBasePage; 15 15 import eu.clarin.cmdi.vlo.wicket.provider.FieldValueConverterProvider; 16 import java.io.IOException; 17 import java.io.InputStream; 18 import java.util.Properties; 16 19 import javax.inject.Inject; 17 20 import org.apache.wicket.Application; … … 51 54 52 55 private ApplicationContext applicationContext; 56 private String appVersionQualifier; 53 57 54 58 /** … … 76 80 // configure Wicket cache according to parameters set in VloConfig 77 81 setupCache(); 82 83 // determine version qualifier (e.g. 'beta'), which can be used to visually mark the base page 84 appVersionQualifier = determineVersionQualifier(); 85 logger.info("Version qualifier: {}", appVersionQualifier); 78 86 } 79 87 … … 127 135 /** 128 136 * 137 * @return a version qualifier, either 'snapshot', 'beta' or null 138 */ 139 private String determineVersionQualifier() { 140 try (InputStream applicationPropertiesStream = getClass().getResourceAsStream("/application.properties")) { 141 Properties applicationProperties = new Properties(); 142 applicationProperties.load(applicationPropertiesStream); 143 final String version = applicationProperties.getProperty("vlo.version"); 144 if (version != null) { 145 if (version.endsWith("-SNAPSHOT")) { 146 return "snapshot"; 147 } else if (version.contains("beta")) { 148 return "beta"; 149 } 150 } 151 } catch (IOException ex) { 152 logger.error("Could not read application properties on init", ex); 153 } 154 return null; 155 } 156 157 /** 158 * 129 159 * @return the active VLO wicket application 130 160 */ … … 173 203 } 174 204 205 public String getAppVersionQualifier() { 206 return appVersionQualifier; 207 } 208 175 209 }
Note: See TracChangeset
for help on using the changeset viewer.