45. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/10/2017 1:01:43 PM 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.

45.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\ImagingCacheImpl\main\src\java\gov\va\med\imaging\storage\cache\impl\jcifs InstanceReadableByteChannelImpl.java Thu Jun 29 17:22:11 2017 UTC
2 C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\ImagingCacheImpl\main\src\java\gov\va\med\imaging\storage\cache\impl\jcifs InstanceReadableByteChannelImpl.java Thu Jul 6 15:02:20 2017 UTC

45.2 Comparison summary

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

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

45.4 Active regular expressions

No regular expressions were active.

45.5 Comparison detail

  1   package go v.va.med.i maging.sto rage.cache .impl.jcif s;
  2  
  3   import gov .va.med.im aging.stor age.cache. InstanceRe adableByte Channel;
  4   import gov .va.med.im aging.stor age.cache. exceptions .InstanceU navailable Exception;
  5  
  6   import jav a.io.File;
  7   import jav a.io.IOExc eption;
  8   import jav a.io.Input Stream;
  9   import jav a.nio.Byte Buffer;
  10   import jav a.nio.chan nels.Chann els;
  11   import jav a.nio.chan nels.Reada bleByteCha nnel;
  12   import jav a.util.zip .Checksum;
  13  
  14   import jci fs.smb.Smb File;
  15  
  16   /**
  17    * A class  that simp ly wraps a  FileChann el that wi ll be used  for readi ng,
  18    * and rel eases a lo ck when th e channel  is closed.
  19    * 
  20    * @author         
BECKEC
  21    *
  22    */
  23   public cla ss Instanc eReadableB yteChannel Impl 
  24   implements  InstanceR eadableByt eChannel
  25   {
  26           /* *
  27            *  
  28            * /
  29           pr ivate fina l JcifsByt eChannelFa ctory fact ory;
  30           pr ivate fina l SmbFile  file;
  31           pr ivate fina l Readable ByteChanne l wrappedC hannel;
  32           pr ivate fina l InputStr eam inStre am;
  33           pr ivate long  openedTim e = 0L;                                       // keep  this so th at we coul d close th e files ou rselves if  the clien t does not
  34           pr ivate long  lastAcces sedTime =  0L;
  35           pr ivate Chec ksum check sum;
  36           pr ivate Stac kTraceElem ent[] inst antiatingS tackTrace  = null;
  37           
  38           In stanceRead ableByteCh annelImpl( JcifsByteC hannelFact ory factor y, SmbFile  file) 
  39           th rows IOExc eption, In stanceUnav ailableExc eption
  40           {
  41                    this (factory,  file, null );
  42           }
  43  
  44           In stanceRead ableByteCh annelImpl( JcifsByteC hannelFact ory factor y, SmbFile  file, Che cksum chec ksum) 
  45           th rows IOExc eption, In stanceUnav ailableExc eption
  46           {
  47                    this .factory =  factory;
  48                    this .file = fi le;
  49                    
  50                    this .factory.l og.debug(" InstanceRe adableByte ChannelImp l, opening  '" + file .getPath()  + "'" );
  51                    // t race the c hannel ins tantiation  so we can  tattle-ta le later i f its not  closed
  52                    if(t his.factor y.isTraceC hannelInst antiation( ))
  53                             instan tiatingSta ckTrace =  Thread.cur rentThread ().getStac kTrace();
  54                    
  55                    inSt ream = fil e.getInput Stream();
  56                    wrap pedChannel  = Channel s.newChann el(inStrea m);
  57                    
  58                    open edTime = S ystem.curr entTimeMil lis();
  59                    last AccessedTi me = opene dTime;
  60                    
  61                    // t ry to acqu ire a shar ed lock on  the file
  62                    //lo ck = wrapp edChannel. tryLock(0L , Long.MAX _VALUE, tr ue);
  63           }
  64           
  65           Sm bFile getF ile()
  66           {
  67                    retu rn this.fi le;
  68           }
  69           
  70           St ackTraceEl ement[] ge tInstantia tingStackT race()
  71           {
  72                    retu rn instant iatingStac kTrace;
  73           }
  74           
  75           pu blic java. util.zip.C hecksum ge tChecksum( )
  76           {
  77                    retu rn this.ch ecksum;
  78           }
  79  
  80           /*  (non-Java doc)
  81            *  @see gov. va.med.ima ging.stora ge.cache.i mpl.filesy stem.Insta nceReadabl eByteChann el#error()
  82            * /
  83           pu blic void  error() 
  84           th rows IOExc eption
  85           {
  86                    clos e(true);
  87           }
  88           
  89           /* *
  90            *  A normal  close, the  cache ite m contents  are valid .
  91            * /
  92           pu blic void  close() 
  93           th rows IOExc eption
  94           {
  95                    clos e(false);
  96           }
  97           
  98           pr ivate void  close(boo lean error Close) 
  99           th rows IOExc eption
  100           {
  101                    IOEx ception io X = null;
  102                    this .factory.l og.debug(" InstanceRe adableByte ChannelImp l, closing  '" + file .getPath()  + "' " +  (errorClos e ? "WITH"  : "withou t") + " de lete");
  103  
  104                    try{  wrappedCh annel.clos e(); }
  105                    catc h(IOExcept ion e)
  106                    {thi s.factory. log.warn(e );} // the  channel m ay already  be closed  through s ome error  or other t imeout, lo g it but k eep going
  107  
  108                    try{  inStream. close(); }
  109                    catc h(IOExcept ion e)
  110                    {thi s.factory. log.warn(e );} // the  stream ma y already  be closed  through so me error o r other ti meout, log  it but ke ep going
  111                    
  112                    if(  errorClose  )
  113                             this.f ile.delete ();
  114                    
  115                    // t he followi ng two ope rations re ally must  occur rega rdless of  the 
  116                    // s uccess of  the previo us IO oper ations, el se channel s will rep eatedly be  closed wh en they ar e already  closed
  117                    fact ory.readab leByteChan nelClosed( this, erro rClose);
  118                    
  119                    this .factory.l og.debug(" InstanceRe adableByte ChannelImp l - '" + f ile.getPat h() + "' c losed " +  (errorClos e ? "WITH"  : "withou t") + " de lete");
  120                    if(i oX != null )
  121                             throw  ioX;
  122           }
  123           
  124  
  125           pu blic boole an isOpen( )
  126           {
  127                    retu rn wrapped Channel !=  null && w rappedChan nel.isOpen ();
  128           }
  129  
  130           pu blic int r ead(ByteBu ffer dst) 
  131           th rows IOExc eption
  132           {
  133                    Chec ksum local ChecksumRe f = getChe cksum();                // just  for perfor mance
  134                    if(l ocalChecks umRef != n ull)
  135                             for(By teBuffer l ocalBuffer  = dst.asR eadOnlyBuf fer(); loc alBuffer.h asRemainin g(); local ChecksumRe f.update(l ocalBuffer .get()) );
  136                    
  137                    last AccessedTi me = Syste m.currentT imeMillis( );
  138                    retu rn wrapped Channel.re ad(dst);
  139           }
  140  
  141           pu blic long  getLastAcc essedTime( )
  142           {
  143                    retu rn lastAcc essedTime;
  144           }
  145  
  146           @O verride
  147           pu blic File  getCacheFi le() {
  148                    // T ODO Auto-g enerated m ethod stub
  149                    retu rn null;
  150           }
  151   }