Produced by Araxis Merge on 12/5/2017 12:06:48 PM Central 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\SiteServiceCommonProvider\main\src\java\gov\va\med\imaging\siteservice\ws\providers | AbstractMessageBodyReaderWriter.java | Mon Dec 4 21:35:20 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\SiteServiceCommonProvider\main\src\java\gov\va\med\imaging\siteservice\ws\providers | AbstractMessageBodyReaderWriter.java | Mon Dec 4 22:05:34 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 276 |
| Changed | 2 | 4 |
| 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 | Package: MAG - Vis tA Imaging | |
| 4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
| 5 | Date Cre ated: Sep 13, 2012 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 8 | Descript ion: | |
| 9 | ||
| 10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 11 | ;; Property of the US Government . | |
| 12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
| 13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
| 14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
| 15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
| 16 | ;; telephon e (301) 73 4-0100. | |
| 17 | ;; | |
| 18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
| 19 | ;; a Class I I medical device. A s such, it may not b e changed | |
| 20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
| 21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
| 22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
| 23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 24 | ||
| 25 | */ | |
| 26 | package go v.va.med.i maging.sit eservice.w s.provider s; | |
| 27 | ||
| 28 | import gov .va.med.im aging.ws.p roviders.A bstractRea derWriter; | |
| 29 | ||
| 30 | import jav a.io.Outpu tStream; | |
| 31 | import jav a.io.Outpu tStreamWri ter; | |
| 32 | import jav a.io.Unsup portedEnco dingExcept ion; | |
| 33 | import jav a.io.Write r; | |
| 34 | ||
| 35 | import jav ax.servlet .ServletCo nfig; | |
| 36 | import jav ax.servlet .ServletCo ntext; | |
| 37 | import jav ax.ws.rs.c ore.Multiv aluedMap; | |
| 38 | import jav ax.ws.rs.e xt.Message BodyReader ; | |
| 39 | import jav ax.ws.rs.e xt.Message BodyWriter ; | |
| 40 | import jav ax.ws.rs.e xt.Provide rs; | |
| 41 | ||
| 42 | import org .apache.lo gging.log4 j.LogManag er; | |
| 43 | import org .apache.lo gging.log4 j.Logger; | |
| 44 | ||
| 45 | /** | |
| 46 | * @author
|
|
| 47 | * | |
| 48 | */ | |
| 49 | public abs tract clas s Abstract MessageBod yReaderWri ter<T> | |
| 50 | extends Ab stractRead erWriter<T > | |
| 51 | implements MessageBo dyReader<T >, Message BodyWriter <T> | |
| 52 | { | |
| 53 | /* * | |
| 54 | * | |
| 55 | * / | |
| 56 | pu blic stati c final St ring DEFAU LT_CHARSET = "UTF-8" ; | |
| 57 | pr ivate fina l Logger l ogger = Lo gManager.g etLogger(t his.getCla ss()); | |
| 58 | pr otected Lo gger getLo gger(){ret urn this.l ogger;} | |
| 59 | ||
| 60 | pr ivate fina l Provider s provider s; | |
| 61 | pr ivate fina l ServletC onfig serv letConfig; | |
| 62 | pr ivate fina l ServletC ontext ser vletContex t; | |
| 63 | ||
| 64 | pu blic Abstr actMessage BodyReader Writer( | |
| 65 | Serv letConfig servletCon fig, | |
| 66 | Serv letContext servletCo ntext, | |
| 67 | Prov iders prov iders) | |
| 68 | { | |
| 69 | this .servletCo nfig = ser vletConfig ; | |
| 70 | this .servletCo ntext = se rvletConte xt; | |
| 71 | this .providers = provide rs; | |
| 72 | } | |
| 73 | ||
| 74 | pu blic Abstr actMessage BodyReader Writer( | |
| 75 | Prov iders prov iders) | |
| 76 | { | |
| 77 | this .servletCo nfig = nul l; | |
| 78 | this .servletCo ntext = nu ll; | |
| 79 | this .providers = provide rs; | |
| 80 | } | |
| 81 | ||
| 82 | pr otected Se rvletConfi g getServl etConfig() {return s ervletConf ig;} | |
| 83 | ||
| 84 | pr otected Se rvletConte xt getServ letContext () {return servletCo ntext;} | |
| 85 | ||
| 86 | pr otected Pr oviders ge tProviders (){return this.provi ders;} | |
| 87 | ||
| 88 | /* * | |
| 89 | * Returns t he element name, as it is to b e written to the XML . | |
| 90 | * | |
| 91 | * @return | |
| 92 | * / | |
| 93 | pu blic abstr act String getElemen tName(); | |
| 94 | ||
| 95 | /* * | |
| 96 | * The Class of the el ement to s erialize. | |
| 97 | * @return | |
| 98 | * / | |
| 99 | pu blic abstr act Class< ?> getElem entClass() ; | |
| 100 | ||
| 101 | /* * | |
| 102 | * Create a Write with the right character set. | |
| 103 | * | |
| 104 | * @param ht tpHeaders | |
| 105 | * @param ou t | |
| 106 | * @return | |
| 107 | * @throws U nsupported EncodingEx ception | |
| 108 | * / | |
| 109 | pu blic synch ronized Wr iter creat eWriter(Mu ltivaluedM ap<String, Object> h ttpHeaders , OutputSt ream out) | |
| 110 | th rows Unsup portedEnco dingExcept ion | |
| 111 | { | |
| 112 | Stri ng charSet = getChar acterSet(h ttpHeaders ); | |
| 113 | retu rn new Out putStreamW riter(out, charSet = = null ? D EFAULT_CHA RSET : cha rSet); | |
| 114 | } | |
| 115 | ||
| 116 | /* * | |
| 117 | * @param ht tpHeaders | |
| 118 | * @return | |
| 119 | * / | |
| 120 | pu blic Strin g getChara cterSet(Mu ltivaluedM ap<String, Object> h ttpHeaders ) | |
| 121 | { | |
| 122 | Stri ng charSet = DEFAULT _CHARSET; | |
| 123 | ||
| 124 | // C ontent-Typ e is in th e form: | |
| 125 | // c ontent[;ch arset] | |
| 126 | // p arse the f irst Conte nt-Type he re to get the charse t | |
| 127 | // if( httpHeader s.contains Key("Conte nt-Type") ) | |
| 128 | // { | |
| 129 | // List<O bject> con tentTypes = httpHead ers.get("C ontent-Typ e"); | |
| 130 | // if(con tentTypes != null && contentTy pes.size() > 0) | |
| 131 | // { | |
| 132 | // MediaTyp e mediaTyp e = (Media Type) cont entTypes.g et(0); | |
| 133 | // String[] contentTy pe = ((Str ing)conten tTypes.get (0)).split (";"); | |
| 134 | // if(conte ntType.len gth > 1) | |
| 135 | // charSet = contentTyp e[1]; | |
| 136 | // } | |
| 137 | // } | |
| 138 | retu rn charSet ; | |
| 139 | } | |
| 140 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.