Produced by Araxis Merge on 7/10/2017 1:01:45 PM Central Daylight 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 | C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm | SecurityConstraintMatch.java | Thu Jun 29 17:23:03 2017 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\ImagingVistaRealm\main\src\java\gov\va\med\imaging\tomcat\vistarealm | SecurityConstraintMatch.java | Thu Jul 6 15:03:43 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 272 |
| 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 | * | |
| 3 | */ | |
| 4 | package go v.va.med.i maging.tom cat.vistar ealm; | |
| 5 | ||
| 6 | import org .apache.to mcat.util. descriptor .web.Secur ityConstra int; | |
| 7 | ||
| 8 | /** | |
| 9 | * A wrapp er for Sec urityConst raint (sec urity-cons traint ele ments in w eb.xml) | |
| 10 | * that ma intains th e matching url patte rn and the type of m atch made to allow f or | |
| 11 | * sorting by applic ability to a URL. | |
| 12 | * | |
| 13 | * @author
|
|
| 14 | * | |
| 15 | */ | |
| 16 | class Secu rityConstr aintMatch | |
| 17 | implements Comparabl e | |
| 18 | { | |
| 19 | pr ivate Secu rityConstr aint secur ityConstra int = null ; | |
| 20 | pr ivate Stri ng urlPatt ern = null ; | |
| 21 | pr ivate bool ean exactM atch = fal se; | |
| 22 | pr ivate bool ean pathMa tch = fals e; | |
| 23 | pr ivate bool ean extens ionMatch = false; | |
| 24 | ||
| 25 | pr ivate Secu rityConstr aintMatch( | |
| 26 | Securi tyConstrai nt securit yConstrain t, | |
| 27 | String urlPatter n, | |
| 28 | boolea n exactMat ch, | |
| 29 | boolea n pathMatc h, | |
| 30 | boolea n extensio nMatch) | |
| 31 | { | |
| 32 | supe r(); | |
| 33 | this .securityC onstraint = security Constraint ; | |
| 34 | this .urlPatter n = urlPat tern; | |
| 35 | this .exactMatc h = exactM atch; | |
| 36 | this .pathMatch = pathMat ch; | |
| 37 | this .extension Match = ex tensionMat ch; | |
| 38 | } | |
| 39 | ||
| 40 | st atic Secur ityConstra intMatch c reateDefau ltSecurity Constraint Match(Secu rityConstr aint secur ityConstra int, Strin g urlPatte rn) | |
| 41 | { | |
| 42 | retu rn new Sec urityConst raintMatch (securityC onstraint, urlPatter n, false, false, fal se); | |
| 43 | } | |
| 44 | st atic Secur ityConstra intMatch c reateExact SecurityCo nstraintMa tch(Securi tyConstrai nt securit yConstrain t, String urlPattern ) | |
| 45 | { | |
| 46 | retu rn new Sec urityConst raintMatch (securityC onstraint, urlPatter n, true, f alse, fals e); | |
| 47 | } | |
| 48 | st atic Secur ityConstra intMatch c reatePathS ecurityCon straintMat ch(Securit yConstrain t security Constraint , String u rlPattern) | |
| 49 | { | |
| 50 | retu rn new Sec urityConst raintMatch (securityC onstraint, urlPatter n, false, true, fals e); | |
| 51 | } | |
| 52 | st atic Secur ityConstra intMatch c reateExten sionSecuri tyConstrai ntMatch(Se curityCons traint sec urityConst raint, Str ing urlPat tern) | |
| 53 | { | |
| 54 | retu rn new Sec urityConst raintMatch (securityC onstraint, urlPatter n, false, false, tru e); | |
| 55 | } | |
| 56 | ||
| 57 | pu blic Secur ityConstra int getSec urityConst raint() | |
| 58 | { | |
| 59 | retu rn this.se curityCons traint; | |
| 60 | } | |
| 61 | ||
| 62 | pu blic Strin g getUrlPa ttern() | |
| 63 | { | |
| 64 | retu rn this.ur lPattern; | |
| 65 | } | |
| 66 | ||
| 67 | pu blic boole an isExact Match() | |
| 68 | { | |
| 69 | retu rn this.ex actMatch; | |
| 70 | } | |
| 71 | ||
| 72 | pu blic boole an isExten sionMatch( ) | |
| 73 | { | |
| 74 | retu rn this.ex tensionMat ch; | |
| 75 | } | |
| 76 | ||
| 77 | pu blic boole an isPathM atch() | |
| 78 | { | |
| 79 | retu rn this.pa thMatch; | |
| 80 | } | |
| 81 | ||
| 82 | /* | |
| 83 | * Compares this objec t with the specified object fo r order. | |
| 84 | * Returns a negative integer, z ero, or a positive i nteger as this objec t is less than, equa l to, or g reater tha n the spec ified obje ct. | |
| 85 | * | |
| 86 | * (non-Java doc) | |
| 87 | * @see java .lang.Comp arable#com pareTo(jav a.lang.Obj ect) | |
| 88 | * / | |
| 89 | pu blic int c ompareTo(O bject o) | |
| 90 | { | |
| 91 | if(o instanceo f Security Constraint Match) | |
| 92 | { | |
| 93 | Securi tyConstrai ntMatch th at = (Secu rityConstr aintMatch) o; | |
| 94 | // exa ct match a lways wins | |
| 95 | if(thi s.isExactM atch()) | |
| 96 | return - 1; | |
| 97 | if(tha t.isExactM atch()) | |
| 98 | return 1 ; | |
| 99 | ||
| 100 | // pat h match ta kes preced ence over extension match | |
| 101 | if(thi s.isPathMa tch() && t hat.isExte nsionMatch ()) | |
| 102 | return - 1; | |
| 103 | if(thi s.isExtens ionMatch() && that.i sPathMatch ()) | |
| 104 | return 1 ; | |
| 105 | ||
| 106 | // if the patter ns are bot h pattern match then the longe r one wins | |
| 107 | if(thi s.isPathMa tch() && t hat.isPath Match()) | |
| 108 | return t hat.getUrl Pattern(). length() - this.getU rlPattern( ).length() ; | |
| 109 | ||
| 110 | // if the patter ns are bot h extensio n match th en, again, the longe r one wins | |
| 111 | // off hand I can 't see how this will happen bu t might as well hand le it | |
| 112 | if(thi s.isExtens ionMatch() && that.i sExtension Match()) | |
| 113 | return t hat.getUrl Pattern(). length() - this.getU rlPattern( ).length() ; | |
| 114 | ||
| 115 | return 0; | |
| 116 | } | |
| 117 | retu rn -1; | |
| 118 | } | |
| 119 | ||
| 120 | @O verride | |
| 121 | pu blic boole an equals( Object o) | |
| 122 | { | |
| 123 | if(o instanceo f Security Constraint Match) | |
| 124 | { | |
| 125 | Securi tyConstrai ntMatch th at = (Secu rityConstr aintMatch) o; | |
| 126 | return | |
| 127 | this.isE xactMatch( ) == that. isExactMat ch() && | |
| 128 | this.isP athMatch() == that.i sPathMatch () && | |
| 129 | this.isE xtensionMa tch() == t hat.isExte nsionMatch () && | |
| 130 | this.get SecurityCo nstraint() .equals(th at.getSecu rityConstr aint()) && | |
| 131 | this.get UrlPattern ().equals( that.getUr lPattern() ); | |
| 132 | } | |
| 133 | ||
| 134 | retu rn false; | |
| 135 | } | |
| 136 | ||
| 137 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.