47. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/5/2017 12:06:35 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.

47.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CacheImpl\main\src\java\gov\va\med\imaging\storage\cache\impl\filesystem FileSystemGroupSet.java Mon Dec 4 21:35:28 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CacheImpl\main\src\java\gov\va\med\imaging\storage\cache\impl\filesystem FileSystemGroupSet.java Mon Dec 4 21:57:38 2017 UTC

47.2 Comparison summary

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

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

47.4 Active regular expressions

No regular expressions were active.

47.5 Comparison detail

  1   package go v.va.med.i maging.sto rage.cache .impl.file system;
  2  
  3   import gov .va.med.im aging.stor age.cache. Group;
  4   import gov .va.med.im aging.stor age.cache. InstanceBy teChannelF actory;
  5   import gov .va.med.im aging.stor age.cache. exceptions .CacheExce ption;
  6   import gov .va.med.im aging.stor age.cache. impl.Persi stentGroup Set;
  7  
  8   import jav a.io.File;
  9   import jav a.io.FileF ilter;
  10   import jav a.lang.ref .SoftRefer ence;
  11   import jav a.util.Ite rator;
  12  
  13   import org .apache.lo gging.log4 j.LogManag er;
  14   import org .apache.lo gging.log4 j.Logger;
  15  
  16   /**
  17    * This cl ass encaps ulates the  collectio n of child  groups in  a FileSys temCacheGr oup and in
  18    * a FileS ystemCache Region.
  19    * It is t he respons ibility of  this clas s to ensur e that the  persisten t (filesys tem)
  20    * and the  transient  (memory)  views of t he Groups  in a group  are consi stent.
  21    * It is a  requireme nt that th is class N OT keep re ferences t o child gr oups that 
  22    * would p revent gar bage colle ction of g roups that  are no lo nger refer enced outs ide
  23    * the cac he (i.e. i f the appl ication do es not hav e a refere nce then t he cache s hould not
  24    * prevent  garbage c ollection) .
  25    * This cl ass should  be the so le modifie r of the g roups refe renced wit hin.
  26    * 
  27    * @author         
BECKEC
  28    *
  29    */
  30   class File SystemGrou pSet
  31   extends Pe rsistentGr oupSet
  32   {
  33           pr ivate stat ic final l ong serial VersionUID  = 1L;
  34           @S uppressWar nings("unu sed")
  35           pr ivate Logg er log = L ogManager. getLogger( this.getCl ass());
  36           pr ivate File  rootDirec tory = nul l;                        // the  directory  in which  all of our  instances  reside in  persisten t storage
  37           
  38           /* *
  39            *  
  40            *  @param ro otDirector y
  41            *  @param by teChannelF actory
  42            *  @param se condsReadW aitsForWri teCompleti on
  43            *  @param se tModificat ionTimeOnR ead
  44            * /
  45           Fi leSystemGr oupSet(
  46                    File  rootDirec tory, 
  47                    Inst anceByteCh annelFacto ry byteCha nnelFactor y,
  48                    int  secondsRea dWaitsForW riteComple tion,
  49                    bool ean setMod ificationT imeOnRead)
  50           {
  51                    supe r(byteChan nelFactory , secondsR eadWaitsFo rWriteComp letion, se tModificat ionTimeOnR ead);
  52                    if(r ootDirecto ry == null )
  53                             throw  new Illega lArgumentE xception(" RootDirect ory must b e a valid  directory. ");
  54                    this .rootDirec tory = roo tDirectory ;
  55           }
  56           
  57           pu blic File  getRootDir ectory()
  58           {
  59                    retu rn rootDir ectory;
  60           }
  61           
  62           /* *
  63            *  Override  this to re duce type  check warn ings
  64            * /
  65           @O verride
  66           @S uppressWar nings("unc hecked")
  67           pu blic Insta nceByteCha nnelFactor y<File> ge tByteChann elFactory( )
  68           {
  69                    retu rn super.g etByteChan nelFactory ();
  70           }
  71           
  72           /* *
  73            *  Get or cr eate a Gro up mapped  to persist ent storag e.
  74            *  
  75            *  @param na me - the g roup name  to get or  create
  76            *  @param cr eate - tru e if the g roups shou ld be crea ted if it  does not e xist\
  77            * /
  78           @O verride
  79           pr otected Gr oup getOrC reate(Stri ng name, b oolean cre ate) 
  80           th rows Cache Exception
  81           {
  82                    File  childGrou pDir = new  File(getR ootDirecto ry(), name );
  83                    File SystemGrou p child =  create ? 
  84                                      FileSyst emGroup.ge tOrCreate( childGroup Dir, getBy teChannelF actory(),  getSeconds ReadWaitsF orWriteCom pletion(),  isSetModi ficationTi meOnRead() ) :
  85                                      FileSyst emGroup.ge t(childGro upDir, get ByteChanne lFactory() , getSecon dsReadWait sForWriteC ompletion( ), isSetMo dification TimeOnRead ());
  86                    
  87                    retu rn child;
  88           }
  89           
  90           /* *
  91            *  Assure th at the int ernal repr esenation  of child i nstances m atches
  92            *  what is i n the pers istent sto rage (file  system). 
  93            * /
  94           pr otected vo id interna lSynchroni zeChildren ()
  95           th rows Cache Exception
  96           {
  97                    prun eNullSoftR eferences( );
  98  
  99                    // g et a list  of all the  child fil es
  100                    for(  File chil dDir : get ChildDirec tories() )
  101                    {
  102                             String  name = ch ildDir.get Name();                 // the f ile name a nd the Ins tance name  are the s ame
  103                             Group  childGroup  = getTran sient(name );           // get a n existing  reference  by name
  104                             if(chi ldGroup ==  null)
  105                             {
  106                                      //childG roup = get Child(name , false);
  107                                      File gro upDir = ne w File(thi s.getRootD irectory() , name);
  108                                      childGro up =  File SystemGrou p.get(grou pDir, getB yteChannel Factory(),  getSecond sReadWaits ForWriteCo mpletion() , isSetMod ificationT imeOnRead( ));
  109                                      SoftRefe rence<File SystemGrou p> groupRe f = new So ftReferenc e<FileSyst emGroup>(  (FileSyste mGroup)chi ldGroup);
  110                                      add( gro upRef );
  111                             }
  112                    }
  113           }
  114  
  115           /* *
  116            *  Get all o f the file s in our d irectory.
  117            *  All files  (not dire ctories) a re conside red child  instances  of this gr oup.
  118            *  
  119            *  @return
  120            * /
  121           pr ivate File [] getChil dDirectori es()
  122           {
  123                    File [] childFi les = getR ootDirecto ry().listF iles(new F ileFilter( )
  124                    {
  125                             public  boolean a ccept(File  pathname)
  126                             {
  127                                      return p athname.is Directory( );
  128                             }
  129                    } );
  130  
  131                    // n ever retur n null, re turn an em pty array  even if th e root dir ectory doe s not exis t
  132                    retu rn childFi les == nul l ? new Fi le[]{} : c hildFiles;
  133           }
  134   }