当前位置: 首页>>代码示例>>Java>>正文


Java FilePath.getIOFile方法代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.FilePath.getIOFile方法的典型用法代码示例。如果您正苦于以下问题:Java FilePath.getIOFile方法的具体用法?Java FilePath.getIOFile怎么用?Java FilePath.getIOFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.vcs.FilePath的用法示例。


在下文中一共展示了FilePath.getIOFile方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: revertFileOrDir

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
private void revertFileOrDir(@NotNull FilePath filePath) throws SVNException, VcsException {
  File file = filePath.getIOFile();
  Info info = mySvnVcs.getInfo(file);
  if (info != null) {
    if (info.isFile()) {
      doRevert(file, false);
    }
    else if (Info.SCHEDULE_ADD.equals(info.getSchedule()) || is17OrGreaterCopy(file, info)) {
      doRevert(file, true);
    }
    else {
      // do update to restore missing directory.
      mySvnVcs.getSvnKitManager().createUpdateClient().doUpdate(file, SVNRevision.HEAD, true);
    }
  }
  else {
    throw new VcsException("Can not get 'svn info' for " + file.getPath());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnRollbackEnvironment.java

示例2: getSelectedIoFiles

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
private File[] getSelectedIoFiles() {
  final List<Change> changes = myViewer.getSelectedChanges();
  final List<File> files = new ArrayList<File>();
  for (Change change : changes) {
    final ContentRevision afterRevision = change.getAfterRevision();
    if (afterRevision != null) {
      final FilePath file = afterRevision.getFile();
      final File ioFile = file.getIOFile();
      files.add(ioFile);
    }
  }
  return files.toArray(new File[files.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ChangesBrowser.java

示例3: createRevisions

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@Nullable
public List<VcsFileRevision> createRevisions(final FilePath filePath) {
  final File file = filePath.getIOFile();
  final VirtualFile root = CvsVfsUtil.refreshAndFindFileByIoFile(file.getParentFile());
  // check if we have a history pane open for a file in a package which has just been deleted
  if (root == null) return null;
  final CvsConnectionSettings env = CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(filePath.getVirtualFileParent());
  final File lightweightFileForFile = CvsUtil.getCvsLightweightFileForFile(file);
  return createRevisions(env, lightweightFileForFile);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CvsHistoryProvider.java

示例4: isNested

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public static boolean isNested(final Collection<FilePath> roots, final File root) {
  for (FilePath filePath : roots) {
    final File ioFile = filePath.getIOFile();

    if (FileUtil.isAncestor(ioFile, root, true)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FilePathUtil.java

示例5: getChangesBetweenRevisions

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@NotNull
@Override
protected List<Change> getChangesBetweenRevisions(@NotNull FilePath path, @NotNull SvnFileRevision rev1, @Nullable SvnFileRevision rev2)
  throws VcsException {
  File file = path.getIOFile();
  SvnTarget target1 = SvnTarget.fromURL(SvnUtil.createUrl(rev1.getURL()), rev1.getRevision());
  SvnTarget target2 = rev2 != null ? SvnTarget.fromURL(SvnUtil.createUrl(rev2.getURL()), rev2.getRevision()) : SvnTarget.fromFile(file);

  return executeDiff(path, target1, target2);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:SvnDiffFromHistoryHandler.java

示例6: executeDiff

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
@NotNull
private List<Change> executeDiff(@NotNull FilePath path, @NotNull SvnTarget target1, @NotNull SvnTarget target2) throws VcsException {
  File file = path.getIOFile();
  ClientFactory factory = target2.isURL() ? myVcs.getFactory(file) : DirectoryWithBranchComparer.getClientFactory(myVcs, file);

  return factory.createDiffClient().compare(target1, target2);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:SvnDiffFromHistoryHandler.java

示例7: checkLocalFileSize

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
private static void checkLocalFileSize(FilePath path) throws VcsException {
  File ioFile = path.getIOFile();
  if (ioFile.exists()) {
    checkContentsSize(ioFile.getPath(), ioFile.length());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ContentRevisionCache.java

示例8: FilePathPathMerger

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public FilePathPathMerger(final FilePath base) {
  myIoDelegate = new IoFilePathMerger(base.getIOFile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PathMerger.java

示例9: HgFile

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public HgFile(@NotNull VirtualFile vcsRoot, FilePath filePath) {
  this(vcsRoot, filePath.getIOFile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:HgFile.java

示例10: rollbackChanges

import com.intellij.openapi.vcs.FilePath; //导入方法依赖的package包/类
public void rollbackChanges(List<Change> changes, List<VcsException> vcsExceptions,
  @NotNull RollbackProgressListener listener) {
  if (changes == null || changes.isEmpty()) {
    return;
  }
  List<FilePath> toDelete = new ArrayList<FilePath>();
  List<FilePath> filePaths = new LinkedList<FilePath>();
  for (Change change : changes) {
    ContentRevision contentRevision;
    if (Change.Type.DELETED == change.getType()) {
      contentRevision = change.getBeforeRevision();
    }
    else {
      contentRevision = change.getAfterRevision();
    }
    if (contentRevision != null) {
      filePaths.add(contentRevision.getFile());
      if (Change.Type.MOVED == change.getType()) {
        toDelete.add(contentRevision.getFile());
      }
    }
  }
  AccessToken token = DvcsUtil.workingTreeChangeStarted(project);
  try {
    revert(filePaths);
    for (FilePath file : toDelete) {
      listener.accept(file);
      try {
        final File ioFile = file.getIOFile();
        if (ioFile.exists()) {
          if (!ioFile.delete()) {
            //noinspection ThrowableInstanceNeverThrown
            vcsExceptions.add(new VcsException("Unable to delete file: " + file));
          }
        }
      }
      catch (Exception e) {
        //noinspection ThrowableInstanceNeverThrown
        vcsExceptions.add(new VcsException("Unable to delete file: " + file, e));
      }
    }
  }
  finally {
    DvcsUtil.workingTreeChangeFinished(project, token);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:HgRollbackEnvironment.java


注:本文中的com.intellij.openapi.vcs.FilePath.getIOFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。