Produced by Araxis Merge on 12/5/2017 12:06:42 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\ImagingBaseWebFacade\main\src\java\gov\va\med\imaging\wado | DocumentServlet.java | Mon Dec 4 21:34:46 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingBaseWebFacade\main\src\java\gov\va\med\imaging\wado | DocumentServlet.java | Mon Dec 4 22:01:21 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 256 |
| 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 | * Package : MAG - Vi stA Imagin g | |
| 3 | * WARNING : Per VHA Directive 2004-038, this routi ne should not be mod ified. | |
| 4 | * Date Cr eated: Apr 17, 2008 | |
| 5 | * Site Na me: Washi ngton OI F ield Offic e, Silver Spring, MD | |
| 6 | * @author
|
|
| 7 | * @versio n 1.0 | |
| 8 | * | |
| 9 | * ------- ---------- ---------- ---------- ---------- ---------- ------- | |
| 10 | * Propert y of the U S Governme nt. | |
| 11 | * No perm ission to copy or re distribute this soft ware is gi ven. | |
| 12 | * Use of unreleased versions of this so ftware req uires the user | |
| 13 | * to exec ute a writ ten test a greement w ith the Vi stA Imagin g | |
| 14 | * Develop ment Offic e of the D epartment of Veteran s Affairs, | |
| 15 | * telepho ne (301) 7 34-0100. | |
| 16 | * | |
| 17 | * The Foo d and Drug Administr ation clas sifies thi s software as | |
| 18 | * a Class II medica l device. As such, it may not be change d | |
| 19 | * in any way. Modi fications to this so ftware may result in an | |
| 20 | * adulter ated medic al device under 21CF R820, the use of whi ch | |
| 21 | * is cons idered to be a viola tion of US Federal S tatutes. | |
| 22 | * ------- ---------- ---------- ---------- ---------- ---------- ------- | |
| 23 | */ | |
| 24 | package go v.va.med.i maging.wad o; | |
| 25 | ||
| 26 | import gov .va.med.Gl obalArtifa ctIdentifi erFactory; | |
| 27 | import gov .va.med.Oc tetSequenc eEscaping; | |
| 28 | import gov .va.med.im aging.chan nels.ByteS treamPump; | |
| 29 | import gov .va.med.im aging.chan nels.Abstr actBytePum p.TRANSFER _TYPE; | |
| 30 | import gov .va.med.im aging.exch ange.busin ess.docume nts.Docume ntRetrieve Result; | |
| 31 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext; | |
| 32 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 33 | ||
| 34 | import jav a.io.IOExc eption; | |
| 35 | ||
| 36 | import jav ax.servlet .ServletEx ception; | |
| 37 | import jav ax.servlet .http.Http ServletReq uest; | |
| 38 | import jav ax.servlet .http.Http ServletRes ponse; | |
| 39 | ||
| 40 | import org .apache.lo gging.log4 j.LogManag er; | |
| 41 | import org .apache.lo gging.log4 j.Logger; | |
| 42 | ||
| 43 | /** | |
| 44 | * @author
|
|
| 45 | * | |
| 46 | */ | |
| 47 | public cla ss Documen tServlet | |
| 48 | extends Ab stractBase ImageServl et | |
| 49 | { | |
| 50 | pr ivate stat ic final l ong serial VersionUID = 1L; | |
| 51 | pr ivate Logg er logger = LogManag er.getLogg er(this.ge tClass()); | |
| 52 | ||
| 53 | /* * | |
| 54 | * | |
| 55 | * / | |
| 56 | pu blic Docum entServlet () | |
| 57 | { | |
| 58 | } | |
| 59 | ||
| 60 | /* * | |
| 61 | * The reque st URL mus t specify the docume nt identif iers in th e form: | |
| 62 | * <home com munity ID> /<reposito ry ID>/<do cument ID> | |
| 63 | * | |
| 64 | * @see gov. va.med.ima ging.wado. AbstractBa seImageSer vlet#doGet (javax.ser vlet.http. HttpServle tRequest, javax.serv let.http.H ttpServlet Response) | |
| 65 | * / | |
| 66 | @O verride | |
| 67 | pr otected vo id doGet(H ttpServlet Request re q, HttpSer vletRespon se resp) | |
| 68 | th rows Servl etExceptio n, IOExcep tion | |
| 69 | { | |
| 70 | Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); | |
| 71 | Stri ng pathInf o = req.ge tPathInfo( ); // inc ludes the URL after the servle t and befo re the que ry string | |
| 72 | ||
| 73 | if(p athInfo == null || p athInfo.is Empty()) | |
| 74 | { | |
| 75 | resp.s endError(H ttpServlet Response.S C_BAD_REQU EST, "The document i dentifiers should be included in the pat h of the U RL."); | |
| 76 | return ; | |
| 77 | } | |
| 78 | ||
| 79 | path Info = pat hInfo.subs tring(1); // get rid of th e leading forward sl ash | |
| 80 | Stri ng[] docum entIdentif iers = pat hInfo.spli t("/"); | |
| 81 | ||
| 82 | if(d ocumentIde ntifiers = = null || documentId entifiers. length < 3 ) | |
| 83 | { | |
| 84 | resp.s endError(H ttpServlet Response.S C_BAD_REQU EST, "The document i dentifiers were not specified in the URL and must be."); | |
| 85 | return ; | |
| 86 | } | |
| 87 | ||
| 88 | Octe tSequenceE scaping rf c2141Escap eEngine = OctetSeque nceEscapin g.createRF C2141Escap eEngine(); | |
| 89 | ||
| 90 | Stri ng homeCom munityId = rfc2141Es capeEngine .unescapeI llegalChar acters(doc umentIdent ifiers[0]) ; | |
| 91 | Stri ng reposit oryId = rf c2141Escap eEngine.un escapeIlle galCharact ers(docume ntIdentifi ers[1]); | |
| 92 | Stri ng documen tId = rfc2 141EscapeE ngine.unes capeIllega lCharacter s(document Identifier s[2]); | |
| 93 | ||
| 94 | logg er.info("G etting doc ument ID ' " + homeCo mmunityId + ":" + re positoryId + ":" + d ocumentId + "'"); | |
| 95 | Docu mentRetrie veResult d rr = null; | |
| 96 | try | |
| 97 | { | |
| 98 | drr = retrieveDo cument( | |
| 99 | Global ArtifactId entifierFa ctory.crea te(homeCom munityId, repository Id, docume ntId) | |
| 100 | ); | |
| 101 | ||
| 102 | ByteSt reamPump p ump = Byte StreamPump .getByteSt reamPump(T RANSFER_TY PE.Network ToNetwork) ; | |
| 103 | resp.s etContentT ype( drr.g etDocument Stream().g etImageFor mat().getM ime() ); | |
| 104 | pump.x fer( drr.g etDocument Stream(), resp.getOu tputStream () ); | |
| 105 | } | |
| 106 | catc h (ImageSe rvletExcep tion isX) | |
| 107 | { | |
| 108 | resp.s endError(i sX.getResp onseCode() , isX.getM essage()); | |
| 109 | } | |
| 110 | catc h(Exceptio n ex) | |
| 111 | { | |
| 112 | logger .error(ex. getMessage (), ex); | |
| 113 | resp.s endError(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR, ex.ge tMessage() ); | |
| 114 | } | |
| 115 | fina lly | |
| 116 | { | |
| 117 | try{dr r.getDocum entStream( ).close(); }catch(Thr owable t){ } | |
| 118 | } | |
| 119 | } | |
| 120 | ||
| 121 | /* (non-Java doc) | |
| 122 | * @see gov. va.med.ima ging.wado. AbstractBa seImageSer vlet#getUs erSiteNumb er() | |
| 123 | * / | |
| 124 | @O verride | |
| 125 | pu blic Strin g getUserS iteNumber( ) | |
| 126 | { | |
| 127 | Tran sactionCon text conte xt = Trans actionCont extFactory .get(); | |
| 128 | retu rn context .getLogger SiteNumber (); | |
| 129 | } | |
| 130 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.