125. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 3/25/2019 8:58:08 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.

125.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IMAG_Source\VISA\Java\VixGuiWebApp\main\src\java\gov\va\med\imaging\exchange JavaLogDownloader.java Mon Mar 18 20:39:05 2019 UTC
2 C:\AraxisMergeCompare\Pri_re\IMAG_Source\VISA\Java\VixGuiWebApp\main\src\java\gov\va\med\imaging\exchange JavaLogDownloader.java Tue Mar 19 12:04:32 2019 UTC

125.2 Comparison summary

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

125.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

125.4 Active regular expressions

No regular expressions were active.

125.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:     DNS     werfej
  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.Stri ngUtil;
  29  
  30   import gov .va.med.im aging.core .FacadeRou terUtility ;
  31  
  32   import jav a.io.IOExc eption;
  33   import jav a.io.Input Stream;
  34   import jav a.io.Input StreamRead er;
  35   import jav a.io.Outpu tStreamWri ter;
  36  
  37   import jav ax.servlet .ServletEx ception;
  38   import jav ax.servlet .http.Http Servlet;
  39   import jav ax.servlet .http.Http ServletReq uest;
  40   import jav ax.servlet .http.Http ServletRes ponse;
  41  
  42   import org .apache.lo gging.log4 j.LogManag er;
  43   import org .apache.lo gging.log4 j.Logger;
  44  
  45   /**
  46    * Servlet  to provid e the abil ity to dow nload a ja va log fro m the VIX
  47    * 
  48    * @author   DNS     werfej
  49    *
  50    */
  51   public cla ss JavaLog Downloader  
  52   extends Ht tpServlet
  53   {
  54  
  55           /* *
  56            *  
  57            * /
  58           pr ivate stat ic final l ong serial VersionUID  = 1L;
  59           
  60           pr ivate tran sient Logg er logger  = LogManag er.getLogg er(this.ge tClass());
  61  
  62  
  63           /*  (non-Java doc)
  64            *  @see java x.servlet. http.HttpS ervlet#doG et(javax.s ervlet.htt p.HttpServ letRequest , javax.se rvlet.http .HttpServl etResponse )
  65            * /
  66           @O verride
  67           pr otected vo id doGet(H ttpServlet Request re quest, Htt pServletRe sponse res ponse)
  68           th rows Servl etExceptio n, IOExcep tion 
  69           {
  70                    LogL ineDecrypt or logLine Decryptor  = new LogL ineDecrypt or();
  71                    Stri ng filenam e = reques t.getParam eter("file name");
  72                    if(f ilename ==  null)
  73                             throw  new Servle tException ("Missing  filename i nput param eter");
  74                    if(f ilename.in dexOf(".." ) >= 0)          // a n attempt  to keep so meone from  downloadi ng from an ywhere on  the machin e
  75                             throw  new Servle tException ("Invalid  filename i nput param eter, cann ot include  '..' in p ath");
  76                    
  77                    // T urn logger  off to av oid recurs ive loggin g
  78                    logg er.debug(" Filename t o download : " + file name);
  79                    logL ineDecrypt or.setDisa bleLogging (filename. toLowerCas e().contai ns("imagin gexchangew ebapp"));
  80                    
  81                    try
  82                    {
  83                             // cle ar the cac he-control  and pragm a to fix I E issue wh ere it can 't downloa d the logs .
  84                             // htt p://suppor t.microsof t.com/defa ult.aspx?s cid=kb;en- us;316431
  85                             // 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
  86                             respon se.setHead er("Pragma ", "");
  87                             respon se.setHead er("Cache- Control",  "");
  88                             VixGui WebAppRout er router  = FacadeRo uterUtilit y.getFacad eRouter (V ixGuiWebAp pRouter.cl ass);
  89                             
  90                             respon se.setCont entType("t ext/plain" );
  91                             respon se.setHead er("Conten t-Disposit ion", "att achment; f ilename=\" " + String Util.clean String(fil ename) + " \"");
  92                             
  93                             InputS tream inpu tStream =  router.get JavaLogFil e(filename );
  94                             LineRe ader reade r = new Li neReader(n ew InputSt reamReader (inputStre am), new c har[]{0x0D , 0x0A});
  95                             Output StreamWrit er writer  = new Outp utStreamWr iter(respo nse.getOut putStream( ));
  96  
  97                             for(St ring logLi ne = reade r.readLine (); logLin e != null;  logLine =  reader.re adLine())
  98                             {
  99                                      logLine  = logLine. replaceAll ("\\x0a",  "");
  100                                      writer.w rite(logLi neDecrypto r.decryptL ine(logLin e) + "\r\n ");
  101                             }
  102                             
  103                             reader .close();
  104                             writer .flush();
  105                             writer .close();
  106  
  107                             //resp onse.getOu tputStream ().close() ;
  108                    }
  109                    catc h(Exceptio n ex)
  110                    {
  111                             throw  new Servle tException (ex);
  112                    }                         
  113           }
  114  
  115  
  116   }