331. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/11/2019 10:54:17 AM Eastern 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.

331.1 Files compared

# Location File Last Modified
1 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\util FileUtils.java Wed May 29 15:26:00 2019 UTC
2 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\util FileUtils.java Mon Jun 10 19:27:47 2019 UTC

331.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 256
Changed 1 2
Inserted 0 0
Removed 0 0

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

331.4 Active regular expressions

No regular expressions were active.

331.5 Comparison detail

  1   /********* ********** ********** ********** ********** ********** *********
  2    * Copyrii ght 2004 V HA. All ri ghts reser ved
  3    ********* ********** ********** ********** ********** ********** *********/
  4   // Package
  5   package go v.va.med.f w.util;
  6  
  7   // Java cl asses
  8   import jav a.io.Buffe redInputSt ream;
  9   import jav a.io.Buffe redOutputS tream;
  10   import jav a.io.File;
  11   import jav a.io.FileI nputStream ;
  12   import jav a.io.FileO utputStrea m;
  13   import jav a.io.IOExc eption;
  14   import jav a.io.Input Stream;
  15   import jav a.io.Outpu tStream;
  16  
  17   import org .apache.co mmons.io.F ilenameUti ls;
  18  
  19   /**
  20    * Provide s convinie nt methods  to perfor m IO opera tions. Ext ends from
  21    * <code>o rg.apache. commons.io .FileUtils </code> to  provide a dditional  methods to
  22    * access  OutputStre am and Inp utStream o f a file e ven if a f ile is not  yet
  23    * created  under sub  directori es.
  24    * 
  25    * Project : Framewor k</br> Cre ated on: 1 :25:02 PM  </br>
  26    * 
  27    * @author   DN S
  28    */
  29   public cla ss FileUti ls extends  org.apach e.commons. io.FileUti ls {
  30  
  31           /* *
  32            *  A default  construct or
  33            * /
  34           pr otected Fi leUtils()  {
  35                    supe r();
  36           }
  37  
  38           /* *
  39            *  Returns a n output s tream of a  file spec ified by i ts name. A  file name  may
  40            *  include i ts whole p ath even i f a path d oesn't exi st
  41            *  
  42            *  @param na me
  43            *              A file n ame
  44            *  @return A n output s tream of a  file
  45            *  @throws I OException
  46            *               In case  of errors  creating  a file
  47            * /
  48           pu blic stati c OutputSt ream getOu tputStream (String na me) throws  IOExcepti on {
  49                    retu rn getOutp utStream(g etFile(nam e));
  50           }
  51  
  52           /* *
  53            *  Returns a n output s tream of a  file spec ified by i ts handler . Creates  a
  54            *  file if i t
  55            *  
  56            *  @param fi le
  57            *              A file t o get an o utput stre am
  58            *  @return A n output s tream of a  file
  59            *  @throws I OException
  60            *               In case  of errors  creating  a file
  61            * /
  62           pu blic stati c OutputSt ream getOu tputStream (File file ) throws I OException  {
  63  
  64                    if ( !file.exis ts()) {
  65                             file.c reateNewFi le();
  66                    }
  67                    retu rn new Buf feredOutpu tStream(ne w FileOutp utStream(f ile));
  68           }
  69  
  70           /* *
  71            *  Returns a n input st ream of a  file speci fied by it s name. A  file name  may
  72            *  include i ts whole p ath even i f a path d oesn't exi st
  73            *  
  74            *  @param na me
  75            *              A file n ame
  76            *  @return A n input st ream of a  file
  77            *  @throws I OException
  78            *               In case  of errors  creating  a file
  79            * /
  80           pu blic stati c InputStr eam getInp utStream(S tring name ) throws I OException  {
  81                    retu rn getInpu tStream(ge tFile(name ));
  82           }
  83  
  84           /* *
  85            *  Returns a n input st ream of a  file speci fied by it s handler.  Creates a
  86            *  file if i t
  87            *  
  88            *  @param fi le
  89            *              A file t o get an o utput stre am
  90            *  @return A n input st ream of a  file
  91            *  @throws I OException
  92            *               In case  of errors  creating  a file
  93            * /
  94           pu blic stati c InputStr eam getInp utStream(F ile file)  throws IOE xception {
  95  
  96                    if ( !file.exis ts()) {
  97                             file.c reateNewFi le();
  98                    }
  99                    retu rn new Buf feredInput Stream(new  FileInput Stream(fil e));
  100           }
  101  
  102           /* *
  103            *  Returns a  file hand le. Create s a direct ory as a f ile parent 's handle  if
  104            *  neccessar y
  105            *  
  106            *  @pparam n ame A file  name incl uding its  path
  107            *  @return A  created f ile in its  directori es if spec ified
  108            *  @throws I OException
  109            *               In case  of errors  creating  a file
  110            * /
  111           pu blic stati c File get File(Strin g name) th rows IOExc eption {
  112  
  113                    // C reates a f ile first  before att empting to  use it
  114                    Stri ng fileNam e = Filena meUtils.ge tName(name );
  115  
  116                    // c reate a pa th
  117                    Stri ng path =  FilenameUt ils.getPat hNoEndSepa rator(name );
  118                    File  parent =  null;
  119                    if ( StringUtil s.isNotBla nk(path))  { // not n ull, not e mpty, not  blank
  120                             parent  = new Fil e(path);
  121                             if (!p arent.exis ts()) {
  122                                      parent.m kdirs();
  123                             }
  124                    }
  125  
  126                    // C reate a fi le with a  parent pat h if reque sted
  127                    retu rn parent  != null ?  new File(p arent, fil eName) : n ew File(fi leName);
  128           }
  129   }