Produced by Araxis Merge on 2/4/2019 11:34:04 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | MHPRO_v1.x.zip\mhpro-resources-master@a26412b610c.zip\ws\src\main\java\gov\va\mobile\vamf\mhpro\common | TemplateProperties.java | Tue Nov 14 19:31:17 2017 UTC |
| 2 | MHPRO_v1.x.zip\mhpro-resources-master@a26412b610c.zip\ws\src\main\java\gov\va\mobile\vamf\mhpro\common | TemplateProperties.java | Mon Feb 4 15:13:47 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 178 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.mobil e.vamf.mhp ro.common; | |
| 2 | ||
| 3 | import jav a.io.IOExc eption; | |
| 4 | import jav a.io.Input Stream; | |
| 5 | import jav a.util.Pro perties; | |
| 6 | ||
| 7 | import org .apache.co mmons.lang 3.StringUt ils; | |
| 8 | import org .slf4j.Log ger; | |
| 9 | import org .slf4j.Log gerFactory ; | |
| 10 | ||
| 11 | /** | |
| 12 | * This cl ass immedi ately load s properti es files ' environmen t.properti es' and | |
| 13 | * 'assess mentVoiceI nfo.proper ties' once in memory . | |
| 14 | * | |
| 15 | * @author gormanch, extended by PII | |
| 16 | */ | |
| 17 | ||
| 18 | public cla ss Templat ePropertie s { | |
| 19 | ||
| 20 | /* * The Cons tant PROPE RTIES_FILE . */ | |
| 21 | pr ivate stat ic final S tring PROP ERTIES_FIL E = "envir onment.pro perties"; | |
| 22 | pr ivate stat ic final S tring PROP ERTIES_FIL E_ASSESSME NT_VOICE_I NFO = "ass essmentVoi ceInfo.pro perties"; | |
| 23 | ||
| 24 | /* * The Cons tant PROPE RTIES. */ | |
| 25 | pr ivate stat ic final P roperties PROPERTIES = new Pro perties(); | |
| 26 | ||
| 27 | /* * The slf4 j logger. */ | |
| 28 | pr ivate fina l static L ogger slf4 jLogger = LoggerFact ory.getLog ger(Templa teProperti es.class); | |
| 29 | ||
| 30 | st atic { | |
| 31 | Clas sLoader cl assLoader = Thread.c urrentThre ad().getCo ntextClass Loader(); | |
| 32 | Inpu tStream pr opertiesFi le = class Loader.get ResourceAs Stream(PRO PERTIES_FI LE); | |
| 33 | Inpu tStream pr opertiesFi leAVI = cl assLoader. getResourc eAsStream( PROPERTIES _FILE_ASSE SSMENT_VOI CE_INFO); | |
| 34 | ||
| 35 | try { | |
| 36 | PROPER TIES.load( properties File); | |
| 37 | PROPER TIES.load( properties FileAVI); | |
| 38 | } ca tch (IOExc eption e) { | |
| 39 | slf4jL ogger.erro r("Could n ot load Pr operties f ile [" + P ROPERTIES_ FILE + "] from the c lasspath." ); | |
| 40 | } fi nally { | |
| 41 | if (pr opertiesFi le != null ) { | |
| 42 | try { | |
| 43 | properties File.close (); | |
| 44 | } catch (IOExcepti on e) { | |
| 45 | slf4jLogge r.error("C ould not c lose Prope rties file [" + PROP ERTIES_FIL E + "]."); | |
| 46 | } | |
| 47 | } | |
| 48 | ||
| 49 | if (pr opertiesFi leAVI != n ull) { | |
| 50 | try { | |
| 51 | properties FileAVI.cl ose(); | |
| 52 | } catch (IOExcepti on e) { | |
| 53 | slf4jLogge r | |
| 54 | .err or("Could not close Properties file [" + PROPERTIE S_FILE_ASS ESSMENT_VO ICE_INFO + "]."); | |
| 55 | } | |
| 56 | } | |
| 57 | } | |
| 58 | } | |
| 59 | ||
| 60 | /* * | |
| 61 | * Instantia tes a new template p roperties. | |
| 62 | * / | |
| 63 | pr ivate Temp lateProper ties() { | |
| 64 | } | |
| 65 | ||
| 66 | /* * | |
| 67 | * Returns t he RxrProp erties ins tance spec ific prope rty value associated | |
| 68 | * with the given key. | |
| 69 | * | |
| 70 | * @param ke y | |
| 71 | * The key to be asso ciated wit h a DAOPro perties in stance | |
| 72 | * specific value. | |
| 73 | * @return T he RxrProp erties ins tance spec ific prope rty value associated | |
| 74 | * w ith the gi ven key. | |
| 75 | * / | |
| 76 | pu blic stati c String g etProperty (String ke y) { | |
| 77 | if ( PROPERTIES == null) | |
| 78 | return null; | |
| 79 | ||
| 80 | retu rn StringU tils.defau ltIfBlank( PROPERTIES .getProper ty(key), n ull); | |
| 81 | } | |
| 82 | ||
| 83 | pu blic stati c int getR equiredInt Property(S tring key) { | |
| 84 | Stri ng a = get Property(k ey); | |
| 85 | if ( a == null) | |
| 86 | throw new Illega lStateExce ption("Req uired prop erty " + k ey + " was not found or was em pty."); | |
| 87 | retu rn Integer .parseInt( a); | |
| 88 | } | |
| 89 | ||
| 90 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.