public static boolean isOpen ( final File file ) throws IOException { boolean open = false ; FileLock lock = null ; try ( RandomAccessFile fileAccess = new RandomAccessFile ( file . getAbsolutePath ( ) , "rw" ) ) { lock = fileAccess . getChannel ( ) . tryLock ( ) ; if ( lock == null ) { open = true ; } else { lock . release ( ) ; } } return open ; }
Not yet implemented . Checks if the given file is open .