public void beforePropertyChange()

in src/net/sourceforge/transparent/VFSListener.java [215:251]


  public void beforePropertyChange(@NotNull VirtualFilePropertyEvent event) {
    VirtualFile file = event.getFile();

    //  In the case of multi-vcs project configurations, we need to skip all
    //  notifications on non-owned files
    if (!VcsUtil.isFileForVcs(file, project, host)) {
      return;
    }

    if (event.getPropertyName().equals(VirtualFile.PROP_WRITABLE)) {
      //  If user managed to perform maerge on the file outside the
      //  environment, clear this mark so that we will not confuse ourselves.
      file.putUserData(TransparentVcs.MERGE_CONFLICT, null);

      //  On every change of the "Writable" property clear the cache of the
      //  content revisions. This will make possible to reread the correct
      //  version content after series of checkins/checkouts.
      ContentRevisionFactory.clearCacheForFile(file.getPath());

      //  If the file is checked in or reverted (either within IDEA or externally
      //  in the CCase Explorer) we need to clear its internally kept activity
      //  name since next time the file can be checked out into the different
      //  activity.
      CCaseViewsManager viewsManager = CCaseViewsManager.getInstance(project);
      viewsManager.removeFileFromActivity(file.getPath());
    }
    else if (event.getPropertyName().equals(VirtualFile.PROP_NAME)) {
      FileStatus status = FileStatusManager.getInstance(project).getStatus(file);
      if (status != FileStatus.ADDED && status != FileStatus.UNKNOWN && status != FileStatus.IGNORED) {
        String parentDir = file.getParent().getPath() + "/";
        String oldName = parentDir + event.getOldValue();
        String newName = parentDir + event.getNewValue();

        storeRenameOrMoveInfo(file.isDirectory() ? host.renamedFolders : host.renamedFiles, oldName, newName);
      }
    }
  }