public void refresh ( ) throws IOException { if ( Files . exists ( file ) ) { fine ( "%s exist" , file ) ; writeLock . lock ( ) ; try { finer ( "start update(%s)" , file ) ; update ( file ) ; finer ( "end update(%s)" , file ) ; } finally { writeLock . unlock ( ) ; } FileTime lmt = Files . getLastModifiedTime ( file ) ; if ( thread == null && lmt . toMillis ( ) + expires < System . currentTimeMillis ( ) ) { thread = new Thread ( this , url . toString ( ) ) ; thread . setDaemon ( true ) ; thread . start ( ) ; fine ( "started thread for %s" , url ) ; } } else { fine ( "%s doesn't exist" , file ) ; run ( ) ; } }
Call to refresh the file . During the call consumer is called at least once .