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


Java LocalFileSystem.refreshIoFiles方法代码示例

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


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

示例1: refreshOutputDirectories

import com.intellij.openapi.vfs.LocalFileSystem; //导入方法依赖的package包/类
public static void refreshOutputDirectories(Collection<File> outputs, boolean async) {
  LocalFileSystem fileSystem = LocalFileSystem.getInstance();
  List<VirtualFile> toRefresh = new ArrayList<VirtualFile>();

  int newDirectories = 0;
  for (File ioOutput : outputs) {
    VirtualFile output = fileSystem.findFileByIoFile(ioOutput);
    if (output != null) {
      toRefresh.add(output);
    }
    else if (ioOutput.exists()) {
      VirtualFile parent = fileSystem.refreshAndFindFileByIoFile(ioOutput.getParentFile());
      if (parent != null) {
        parent.getChildren();
        toRefresh.add(parent);
        newDirectories++;
      }
    }
  }
  if (newDirectories > 10) {
    LOG.info(newDirectories + " new output directories were created, refreshing their parents together to avoid too many rootsChange events");
    RefreshQueue.getInstance().refresh(async, false, null, toRefresh);
  }
  else {
    LOG.debug("Refreshing " + outputs.size() + " outputs");
    fileSystem.refreshIoFiles(outputs, async, false, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:CompilerUtil.java

示例2: putAdministrative17UnderVfsListener

import com.intellij.openapi.vfs.LocalFileSystem; //导入方法依赖的package包/类
/**
 * TODO: Currently could not find exact case when "file status is not correctly refreshed after external commit" that is covered by this
 * TODO: code. So for now, checks for formats greater than 1.7 are not added here.
 */
private static void putAdministrative17UnderVfsListener(Set<NestedCopyInfo> pointInfos) {
  if (! SvnVcs.ourListenToWcDb) return;
  final LocalFileSystem lfs = LocalFileSystem.getInstance();
  for (NestedCopyInfo info : pointInfos) {
    if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(info.getFormat()) && ! NestedCopyType.switched.equals(info.getType())) {
      final VirtualFile root = info.getFile();
      lfs.refreshIoFiles(Collections.singletonList(SvnUtil.getWcDb(new File(root.getPath()))), true, false, null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SvnChangeProvider.java


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