public synchronized void unwatch( CertificateStore store )
    {
        if ( store == null )
        {
            throw new IllegalArgumentException( "Argument 'store' cannot be null." );
        }

        synchronized ( watchedStores )
        {
            watchedStores.remove( store );
            final Path dir = store.getConfiguration().getFile().toPath().normalize().getParent();

            // Check if there are any other stores being watched in the same directory.
            if ( watchedStores.containsValue( dir ) )
            {
                return;
            }

            final WatchKey key = watchedPaths.remove( dir );
            if ( key != null )
            {
                key.cancel();
            }
        }
    }
Stop watching the file that backs a Certificate Store for changes

@param store The certificate store (cannot be null).
xmppserver/src/main/java/org/jivesoftware/openfire/keystore/CertificateStoreWatcher.java