Produced by Araxis Merge on 12/13/2018 10:35:26 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 | v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\fw\io\parser | WildcardFileFilter.java | Fri Dec 7 17:36:38 2018 UTC |
| 2 | v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\fw\io\parser | WildcardFileFilter.java | Wed Dec 12 22:26:42 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 176 |
| 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 | /********* ********** ********** ********** ********** ********** ********* | |
| 2 | * Copyrii ght 2005 V HA. All ri ghts reser ved | |
| 3 | ********* ********** ********** ********** ********** ********** *********/ | |
| 4 | ||
| 5 | package go v.va.med.f w.io.parse r; | |
| 6 | ||
| 7 | import jav a.io.File; | |
| 8 | import jav a.io.Filen ameFilter; | |
| 9 | import jav a.util.Loc ale; | |
| 10 | import jav a.util.Str ingTokeniz er; | |
| 11 | ||
| 12 | import gov .va.med.fw .util.Inva lidConfigu rationExce ption; | |
| 13 | ||
| 14 | /** | |
| 15 | * Filenam eFilter im plementati on for mat ching exte nsions. | |
| 16 | * | |
| 17 | * Created Feb 17, 2 006 1:14:4 1 PM | |
| 18 | * | |
| 19 | * DNS | |
| 20 | */ | |
| 21 | public cla ss Wildcar dFileFilte r implemen ts Filenam eFilter { | |
| 22 | St ring wildc ard = null ; | |
| 23 | pr ivate bool ean caseIn sensitive; | |
| 24 | ||
| 25 | pu blic Wildc ardFileFil ter(String wildcard) { | |
| 26 | this .wildcard = wildcard ; | |
| 27 | } | |
| 28 | ||
| 29 | pu blic Wildc ardFileFil ter(String wildcard, boolean c aseInsensi tive) { | |
| 30 | this .wildcard = wildcard ; | |
| 31 | this .caseInsen sitive = c aseInsensi tive; | |
| 32 | } | |
| 33 | ||
| 34 | /* * | |
| 35 | * Accepts t he wildcar d formats *.ext, foo *, foo*.ex t, *foo* | |
| 36 | * | |
| 37 | * @see java .io.Filena meFilter#a ccept(java .io.File, java.lang. String) | |
| 38 | * / | |
| 39 | pu blic boole an accept( File dir, String nam e) { | |
| 40 | int firstIndex = wildcar d.indexOf( '*'); | |
| 41 | int lastIndex = wildcard .lastIndex Of('*'); | |
| 42 | ||
| 43 | bool ean accept = false; | |
| 44 | ||
| 45 | Stri ng wildcar dToUse = w ildcard; | |
| 46 | if ( caseInsens itive) { | |
| 47 | name = name.toUp perCase(Lo cale.ENGLI SH); | |
| 48 | wildca rdToUse = wildcard.t oUpperCase (); | |
| 49 | } | |
| 50 | Stri ngTokenize r st = new StringTok enizer(wil dcardToUse , "*"); | |
| 51 | ||
| 52 | // * .ext | |
| 53 | if ( firstIndex == 0 && l astIndex = = 0) { | |
| 54 | accept = name.en dsWith(st. nextToken( )); | |
| 55 | ||
| 56 | }// foo* | |
| 57 | else if (first Index > 0 && firstIn dex == las tIndex && st.countTo kens() == 1) { | |
| 58 | accept = name.st artsWith(s t.nextToke n()); | |
| 59 | ||
| 60 | }// foo*.ext | |
| 61 | else if (first Index > 0 && firstIn dex == las tIndex && st.countTo kens() == 2) { | |
| 62 | accept = name.st artsWith(s t.nextToke n()) && na me.endsWit h(st.nextT oken()); | |
| 63 | ||
| 64 | }// *foo* | |
| 65 | else if (first Index == 0 && lastIn dex > 0 && st.countT okens() == 1) { | |
| 66 | accept = name.in dexOf(st.n extToken() ) != 1; | |
| 67 | ||
| 68 | } el se { | |
| 69 | throw new Invali dConfigura tionExcept ion( | |
| 70 | "Wild card specified for input FileLocati on is not supported: " + wildc ard); | |
| 71 | } | |
| 72 | retu rn accept; | |
| 73 | } | |
| 74 | ||
| 75 | /* * | |
| 76 | * @return R eturns the caseInsen sitive. | |
| 77 | * / | |
| 78 | pu blic boole an isCaseI nsensitive () { | |
| 79 | retu rn caseIns ensitive; | |
| 80 | } | |
| 81 | ||
| 82 | /* * | |
| 83 | * @param ca seInsensit ive | |
| 84 | * The case Insensitiv e to set. | |
| 85 | * / | |
| 86 | pu blic void setCaseIns ensitive(b oolean cas eInsensiti ve) { | |
| 87 | this .caseInsen sitive = c aseInsensi tive; | |
| 88 | } | |
| 89 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.