55. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/5/2018 10:24:16 AM 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.

55.1 Files compared

# Location File Last Modified
1 patch_205_build_9.zip\Java\VixGuiWebApp\main\src\java\gov\va\med\imaging\exchange JavaLogDownloader.java Wed May 30 14:35:23 2018 UTC
2 patch_205_build_9.zip\Java\VixGuiWebApp\main\src\java\gov\va\med\imaging\exchange JavaLogDownloader.java Mon Jun 4 20:50:38 2018 UTC

55.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 200
Changed 2 4
Inserted 0 0
Removed 0 0

55.3 Comparison options

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

55.4 Active regular expressions

No regular expressions were active.

55.5 Comparison detail

  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: Dec  16, 2009
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:     PII
  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.exc hange;
  27  
  28   import gov .va.med.im aging.core .FacadeRou terUtility ;
  29  
  30   import jav a.io.IOExc eption;
  31   import jav a.io.Input Stream;
  32   import jav a.io.Input StreamRead er;
  33   import jav a.io.Outpu tStreamWri ter;
  34  
  35   import jav ax.servlet .ServletEx ception;
  36   import jav ax.servlet .http.Http Servlet;
  37   import jav ax.servlet .http.Http ServletReq uest;
  38   import jav ax.servlet .http.Http ServletRes ponse;
  39  
  40   /**
  41    * Servlet  to provid e the abil ity to dow nload a ja va log fro m the VIX
  42    * 
  43    * @author   PII
  44    *
  45    */
  46   public cla ss JavaLog Downloader  
  47   extends Ht tpServlet
  48   {
  49  
  50           /* *
  51            *  
  52            * /
  53           pr ivate stat ic final l ong serial VersionUID  = 1L;
  54  
  55           /*  (non-Java doc)
  56            *  @see java x.servlet. http.HttpS ervlet#doG et(javax.s ervlet.htt p.HttpServ letRequest , javax.se rvlet.http .HttpServl etResponse )
  57            * /
  58           @O verride
  59           pr otected vo id doGet(H ttpServlet Request re quest, Htt pServletRe sponse res ponse)
  60           th rows Servl etExceptio n, IOExcep tion 
  61           {
  62                    LogL ineDecrypt or logLine Decryptor  = new LogL ineDecrypt or();
  63                    Stri ng filenam e = reques t.getParam eter("file name");
  64                    if(f ilename ==  null)
  65                             throw  new Servle tException ("Missing  filename i nput param eter");
  66                    if(f ilename.in dexOf(".." ) >= 0)          // a n attempt  to keep so meone from  downloadi ng from an ywhere on  the machin e
  67                             throw  new Servle tException ("Invalid  filename i nput param eter, cann ot include  '..' in p ath");
  68                    try
  69                    {
  70                             // cle ar the cac he-control  and pragm a to fix I E issue wh ere it can 't downloa d the logs .
  71                             // htt p://suppor t.microsof t.com/defa ult.aspx?s cid=kb;en- us;316431
  72                             // IE  tries to o bey the no -caching r ule and ca nnot downl oad the fi le, cleari ng these h eaders fix es the iss ue
  73                             respon se.setHead er("Pragma ", "");
  74                             respon se.setHead er("Cache- Control",  "");
  75                             VixGui WebAppRout er router  = FacadeRo uterUtilit y.getFacad eRouter (V ixGuiWebAp pRouter.cl ass);
  76                             
  77                             respon se.setCont entType("t ext/plain" );
  78                             respon se.setHead er("Conten t-Disposit ion", "att achment; f ilename=\" " + filena me + "\"") ;
  79                             
  80                             InputS tream inpu tStream =  router.get JavaLogFil e(filename );
  81                             LineRe ader reade r = new Li neReader(n ew InputSt reamReader (inputStre am), new c har[]{0x0D , 0x0A});
  82                             Output StreamWrit er writer  = new Outp utStreamWr iter(respo nse.getOut putStream( ));
  83  
  84                             for(St ring logLi ne = reade r.readLine (); logLin e != null;  logLine =  reader.re adLine())
  85                             {
  86                                      logLine  = logLine. replaceAll ("\\x0a",  "");
  87                                      writer.w rite(logLi neDecrypto r.decryptL ine(logLin e) + "\r\n ");
  88                             }
  89                             
  90                             reader .close();
  91                             writer .flush();
  92                             writer .close();
  93                             
  94                             //resp onse.getOu tputStream ().close() ;
  95                    }
  96                    catc h(Exceptio n ex)
  97                    {
  98                             throw  new Servle tException (ex);
  99                    }                         
  100           }
  101  
  102   }