@ Trivial protected ZipFile reacquireZipFile ( ) throws IOException , ZipException { String methodName = "reacquireZipFile" ; File rawZipFile = new File ( path ) ; long newZipLength = FileUtils . fileLength ( rawZipFile ) ; long newZipLastModified = FileUtils . fileLastModified ( rawZipFile ) ; boolean zipFileChanged = false ; if ( newZipLength != zipLength ) { zipFileChanged = true ; if ( openCount > closeCount ) { // Tr.warning(tc, methodName + // " Zip [ " + path + " ]:" + // " Update length from [ " + Long.valueOf(zipLength) + " ]" + // " to [ " + Long.valueOf(newZipLength) + " ]"); Tr . warning ( tc , "reaper.unexpected.length.change" , path , Long . valueOf ( zipLength ) , Long . valueOf ( newZipLength ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " Zip [ " + path + " ]:" + " Update length from [ " + Long . valueOf ( zipLength ) + " ]" + " to [ " + Long . valueOf ( newZipLength ) + " ]" ) ; } } } if ( newZipLastModified != zipLastModified ) { zipFileChanged = true ; if ( openCount > closeCount ) { // Tr.warning(tc, methodName + // " Zip [ " + path + " ]:" + // " Update last modified from [ " + Long.valueOf(zipLastModified) + " ]" + // " to [ " + Long.valueOf(newZipLastModified) + " ]"); Tr . warning ( tc , "reaper.unexpected.lastmodified.change" , path , Long . valueOf ( zipLastModified ) , Long . valueOf ( newZipLastModified ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " Zip [ " + path + " ]:" + " Update last modified from [ " + Long . valueOf ( zipLastModified ) + " ]" + " to [ " + Long . valueOf ( newZipLastModified ) + " ]" ) ; } } } if ( zipFileChanged ) { if ( openCount > closeCount ) { // Tr.warning(tc, methodName + " Reopen [ " + path + " ]"); Tr . warning ( tc , "reaper.reopen.active" , path ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " Reopen [ " + path + " ]" ) ; } } @ SuppressWarnings ( "unused" ) ZipFile oldZipFile = closeZipFile ( ) ; @ SuppressWarnings ( "unused" ) ZipFile newZipFile = openZipFile ( newZipLength , newZipLastModified ) ; // throws IOException, ZipException } return zipFile ; }
Re - acquire the ZIP file .