public InputStream getInputStream ( ) throws IOException { acquireLock ( ) ; try { isClosed = false ; forWrite = false ; LOG . trace ( "Starts read '{}'" , file ) ; verifyAndRecover ( ) ; InputStream is = new ProxyInputStream ( new FileInputStream ( file . toFile ( ) ) ) { @ Override public void close ( ) throws IOException { if ( isClosed ) { return ; } try { super . close ( ) ; } finally { release ( ) ; isClosed = true ; stream = null ; } LOG . trace ( "Finishes read '{}'" , file ) ; } } ; stream = is ; return is ; } catch ( Exception ex ) { release ( ) ; throw ex ; } }
Returns an input stream for the requested file .