com.intellij.openapi.vcs.changes.FilePathsHelper Java Examples

The following examples show how to use com.intellij.openapi.vcs.changes.FilePathsHelper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ContentRevisionCache.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void clearCurrent(Set<String> paths) {
  final HashSet<String> converted = new HashSet<>();
  for (String path : paths) {
    converted.add(FilePathsHelper.convertPath(path));
  }
  synchronized (myLock) {
    final Set<CurrentKey> toRemove = new HashSet<>();
    myCurrentRevisionsCache.iterateKeys(new Consumer<CurrentKey>() {
      @Override
      public void consume(CurrentKey currentKey) {
        if (converted.contains(FilePathsHelper.convertPath(currentKey.getPath().getPath()))) {
          toRemove.add(currentKey);
        }
      }
    });
    for (CurrentKey key : toRemove) {
      myCurrentRevisionsCache.remove(key);
    }
  }
}
 
Example #2
Source File: CharsetEP.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void consumeContentBeforePatchApplied(@Nonnull String path,
                                             @Nonnull CharSequence content,
                                             CommitContext commitContext) {
  if (commitContext == null) return;
  Map<String, String> map = commitContext.getUserData(ourName);
  if (map == null) {
    map = new HashMap<String, String>();
    commitContext.putUserData(ourName, map);
  }
  final File file = new File(myBaseDir, path);
  map.put(FilePathsHelper.convertPath(file.getPath()), content.toString());
}
 
Example #3
Source File: CharsetEP.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static String getCharset(final String path, final CommitContext commitContext) {
  if (commitContext == null) return null;
  final Map<String, String> userData = commitContext.getUserData(ourName);
  return userData == null ? null : userData.get(FilePathsHelper.convertPath(path));
}
 
Example #4
Source File: DiffShelvedChangesAction.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public int compare(DiffRequestProducer o1, DiffRequestProducer o2) {
  return FilePathsHelper.convertPath(o1.getName()).compareTo(FilePathsHelper.convertPath(o2.getName()));
}
 
Example #5
Source File: StaticFilePath.java    From consulo with Apache License 2.0 4 votes vote down vote up
public StaticFilePath(boolean isDirectory, String path, VirtualFile vf) {
  myIsDirectory = isDirectory;
  myPath = path;
  myVf = vf;
  myKey = FilePathsHelper.convertPath(path);
}