/**
  * Manual refresh, displays a dialog.
  *
  * @param bAsk ask for refreshing type (deep or fast ?)
  * @param bAfterMove is this refresh done after a device location change ?
  * @param forcedDeep : override bAsk and force a deep refresh
  * @param dirsToRefresh : only refresh specified dirs, or all of them if null
  */
 public void manualRefresh(
     final boolean bAsk,
     final boolean bAfterMove,
     final boolean forcedDeep,
     List<Directory> dirsToRefresh) {
   int i = 0;
   try {
     i = prepareRefresh(bAsk);
     if (i == OPTION_REFRESH_CANCEL) {
       return;
     }
     bAlreadyRefreshing = true;
   } catch (JajukException je) {
     Messages.showErrorMessage(je.getCode());
     Log.debug(je);
     return;
   }
   try {
     reporter = new ManualDeviceRefreshReporter(this);
     reporter.startup();
     // clean old files up (takes a while)
     if (!bAfterMove) {
       cleanRemovedFiles(dirsToRefresh);
     }
     reporter.cleanupDone();
     // Actual refresh
     refreshCommand(((i == Device.OPTION_REFRESH_DEEP) || forcedDeep), true, dirsToRefresh);
     // cleanup logical items
     org.jajuk.base.Collection.cleanupLogical();
     // if it is a move, clean old files *after* the refresh
     if (bAfterMove) {
       cleanRemovedFiles(dirsToRefresh);
     }
     // notify views to refresh
     ObservationManager.notify(new JajukEvent(JajukEvents.DEVICE_REFRESH));
     // Commit collection at each refresh (can be useful if
     // application
     // is closed brutally with control-C or shutdown and that
     // exit hook has no time to perform commit).
     // But don't commit when any device is refreshing to avoid collisions.
     if (!DeviceManager.getInstance().isAnyDeviceRefreshing()) {
       try {
         org.jajuk.base.Collection.commit(SessionService.getConfFileByPath(Const.FILE_COLLECTION));
       } catch (final IOException e) {
         Log.error(e);
       }
     }
   } finally {
     // Do not let current reporter as a manual reporter because it would fail
     // in NPE with auto-refresh
     reporter = null;
     // Make sure to unlock refreshing
     bAlreadyRefreshing = false;
   }
 }