本文整理汇总了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);
}
}
示例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);
}
}
}