// {{{ maybeReloadDirectory() method
  public void maybeReloadDirectory(String path) {
    String browserDir = browser.getDirectory();
    String symlinkBrowserDir;
    if (MiscUtilities.isURL(browserDir)) {
      symlinkBrowserDir = browserDir;
    } else {
      symlinkBrowserDir = MiscUtilities.resolveSymlinks(browserDir);
    }

    if (MiscUtilities.pathsEqual(path, symlinkBrowserDir)) {
      saveExpansionState();
      loadDirectory(null, browserDir, false);
    }

    // because this method is called for *every* VFS update,
    // we don't want to scan the tree all the time. So we
    // use the following algorithm to determine if the path
    // might be part of the tree:
    // - if the path starts with the browser's current directory,
    //   we do the tree scan
    // - if the browser's directory is 'favorites:' -- we have to
    //   do the tree scan, as every path can appear under the
    //   favorites list
    // - if the browser's directory is 'roots:' and path is on
    //   the local filesystem, do a tree scan

    if (!browserDir.startsWith(FavoritesVFS.PROTOCOL)
        && !browserDir.startsWith(FileRootsVFS.PROTOCOL)
        && !path.startsWith(symlinkBrowserDir)) return;

    if (browserDir.startsWith(FileRootsVFS.PROTOCOL)
        && MiscUtilities.isURL(path)
        && !"file".equals(MiscUtilities.getProtocolOfURL(path))) return;

    table.maybeReloadDirectory(path);
  } // }}}