nl_tokens: Refreshes the <code > LiveFile< / code > if the file was renamed the path will have the new name .
pl_tokens: public LiveFile refresh ( ) throws IOException { LiveFile refresh = this ; boolean changed ; try { BasicFileAttributes attrs = Files . readAttributes ( path , BasicFileAttributes . class ) ; String iNodeCurrent = attrs . fileKey ( ) . toString ( ) ; int headLenCurrent = ( int ) Math . <mask> ( headLen , attrs . size ( ) ) ; String headHashCurrent = computeHash ( path , headLenCurrent ) ; changed = ! this . iNode . equals ( iNodeCurrent ) || ! this . headHash . equals ( headHashCurrent ) ; } catch ( NoSuchFileException ex ) { changed = true ; } if ( changed ) { try ( DirectoryStream < Path > directoryStream = Files . newDirectoryStream ( path . getParent ( ) ) ) { for ( Path path : directoryStream ) { BasicFileAttributes attrs = Files . readAttributes ( path , BasicFileAttributes . class ) ; String iNode = attrs . fileKey ( ) . toString ( ) ; int headLen = ( int ) Math . min ( this . headLen , attrs . size ( ) ) ; String headHash = computeHash ( path , headLen ) ; if ( iNode . equals ( this . iNode ) && headHash . equals ( this . headHash ) ) { if ( headLen == 0 ) { headLen = ( int ) Math . min ( HEAD_LEN , attrs . size ( ) ) ; headHash = computeHash ( path , headLen ) ; } refresh = new LiveFile ( path , iNode , headHash , headLen ) ; break ; } } } } return refresh ; }