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


Java NewVirtualFile.markClean方法代码示例

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


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

示例1: scan

import com.intellij.openapi.vfs.newvfs.NewVirtualFile; //导入方法依赖的package包/类
public void scan() {
  NewVirtualFile root = myRefreshQueue.pullFirst().first;
  boolean rootDirty = root.isDirty();
  debug(LOG, "root=%s dirty=%b", root, rootDirty);
  if (!rootDirty) return;

  NewVirtualFileSystem fs = root.getFileSystem();
  FileAttributes rootAttributes = fs.getAttributes(root);
  if (rootAttributes == null) {
    scheduleDeletion(root);
    root.markClean();
    return;
  }
  else if (rootAttributes.isDirectory()) {
    fs = PersistentFS.replaceWithNativeFS(fs);
  }

  myRefreshQueue.addLast(pair(root, rootAttributes));
  try {
    processQueue(fs, PersistentFS.getInstance());
  }
  catch (RefreshCancelledException e) {
    LOG.debug("refresh cancelled");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:RefreshWorker.java

示例2: scan

import com.intellij.openapi.vfs.newvfs.NewVirtualFile; //导入方法依赖的package包/类
public void scan() {
  NewVirtualFile root = myRefreshQueue.pullFirst().first;
  boolean rootDirty = root.isDirty();
  if (LOG.isDebugEnabled()) LOG.debug("root=" + root + " dirty=" + rootDirty);
  if (!rootDirty) return;

  NewVirtualFileSystem fs = root.getFileSystem();
  FileAttributes rootAttributes = fs.getAttributes(root);
  if (rootAttributes == null) {
    scheduleDeletion(root);
    root.markClean();
    return;
  }
  else if (rootAttributes.isDirectory()) {
    fs = PersistentFS.replaceWithNativeFS(fs);
  }

  myRefreshQueue.addLast(pair(root, rootAttributes));
  try {
    processQueue(fs, PersistentFS.getInstance());
  }
  catch (RefreshCancelledException e) {
    LOG.debug("refresh cancelled");
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:RefreshWorker.java

示例3: processQueue

import com.intellij.openapi.vfs.newvfs.NewVirtualFile; //导入方法依赖的package包/类
private void processQueue(NewVirtualFileSystem fs, PersistentFS persistence) throws RefreshCancelledException {
  TObjectHashingStrategy<String> strategy = FilePathHashingStrategy.create(fs.isCaseSensitive());

  while (!myRefreshQueue.isEmpty()) {
    Pair<NewVirtualFile, FileAttributes> pair = myRefreshQueue.pullFirst();
    NewVirtualFile file = pair.first;
    boolean fileDirty = file.isDirty();
    debug(LOG, "file=%s dirty=%b", file, fileDirty);
    if (!fileDirty) continue;

    checkCancelled(file);

    FileAttributes attributes = pair.second != null ? pair.second : fs.getAttributes(file);
    if (attributes == null) {
      scheduleDeletion(file);
      continue;
    }

    NewVirtualFile parent = file.getParent();
    if (parent != null && checkAndScheduleFileTypeChange(parent, file, attributes)) {
      // ignore everything else
      file.markClean();
      continue ;
    }

    if (file.isDirectory()) {
      boolean fullSync = ((VirtualDirectoryImpl)file).allChildrenLoaded();
      if (fullSync) {
        fullDirRefresh(fs, persistence, strategy, (VirtualDirectoryImpl)file);
      }
      else {
        partialDirRefresh(fs, strategy, (VirtualDirectoryImpl)file);
      }
    }
    else {
      long currentTimestamp = persistence.getTimeStamp(file);
      long upToDateTimestamp = attributes.lastModified;
      long currentLength = persistence.getLastRecordedLength(file);
      long upToDateLength = attributes.length;

      if (currentTimestamp != upToDateTimestamp || currentLength != upToDateLength) {
        scheduleUpdateContent(file);
      }
    }

    boolean currentWritable = persistence.isWritable(file);
    boolean upToDateWritable = attributes.isWritable();
    if (LOG_ATTRIBUTES.isDebugEnabled()) {
      LOG_ATTRIBUTES.debug("file=" + file + " writable vfs=" + file.isWritable() + " persistence=" + currentWritable + " real=" + upToDateWritable);
    }
    if (currentWritable != upToDateWritable) {
      scheduleAttributeChange(file, VirtualFile.PROP_WRITABLE, currentWritable, upToDateWritable);
    }

    if (SystemInfo.isWindows) {
      boolean currentHidden = file.is(VFileProperty.HIDDEN);
      boolean upToDateHidden = attributes.isHidden();
      if (currentHidden != upToDateHidden) {
        scheduleAttributeChange(file, VirtualFile.PROP_HIDDEN, currentHidden, upToDateHidden);
      }
    }

    if (attributes.isSymLink()) {
      String currentTarget = file.getCanonicalPath();
      String upToDateTarget = fs.resolveSymLink(file);
      String upToDateVfsTarget = upToDateTarget != null ? FileUtil.toSystemIndependentName(upToDateTarget) : null;
      if (!Comparing.equal(currentTarget, upToDateVfsTarget)) {
        scheduleAttributeChange(file, VirtualFile.PROP_SYMLINK_TARGET, currentTarget, upToDateVfsTarget);
      }
    }

    if (myIsRecursive || !file.isDirectory()) {
      file.markClean();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:77,代码来源:RefreshWorker.java

示例4: forceMarkDirty

import com.intellij.openapi.vfs.newvfs.NewVirtualFile; //导入方法依赖的package包/类
private static void forceMarkDirty(NewVirtualFile file) {
  file.markClean();  // otherwise consequent markDirty() won't have any effect
  file.markDirty();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:RefreshWorker.java

示例5: processQueue

import com.intellij.openapi.vfs.newvfs.NewVirtualFile; //导入方法依赖的package包/类
private void processQueue(NewVirtualFileSystem fs, PersistentFS persistence) throws RefreshCancelledException {
  TObjectHashingStrategy<String> strategy = FilePathHashingStrategy.create(fs.isCaseSensitive());

  while (!myRefreshQueue.isEmpty()) {
    Pair<NewVirtualFile, FileAttributes> pair = myRefreshQueue.pullFirst();
    NewVirtualFile file = pair.first;
    boolean fileDirty = file.isDirty();
    if (LOG.isTraceEnabled()) LOG.trace("file=" + file + " dirty=" + fileDirty);
    if (!fileDirty) continue;

    checkCancelled(file);

    FileAttributes attributes = pair.second != null ? pair.second : fs.getAttributes(file);
    if (attributes == null) {
      scheduleDeletion(file);
      continue;
    }

    NewVirtualFile parent = file.getParent();
    if (parent != null && checkAndScheduleFileTypeChange(parent, file, attributes)) {
      // ignore everything else
      file.markClean();
      continue ;
    }

    if (file.isDirectory()) {
      boolean fullSync = ((VirtualDirectoryImpl)file).allChildrenLoaded();
      if (fullSync) {
        fullDirRefresh(fs, persistence, strategy, (VirtualDirectoryImpl)file);
      }
      else {
        partialDirRefresh(fs, strategy, (VirtualDirectoryImpl)file);
      }
    }
    else {
      long currentTimestamp = persistence.getTimeStamp(file);
      long upToDateTimestamp = attributes.lastModified;
      long currentLength = persistence.getLastRecordedLength(file);
      long upToDateLength = attributes.length;

      if (currentTimestamp != upToDateTimestamp || currentLength != upToDateLength) {
        scheduleUpdateContent(file);
      }
    }

    boolean currentWritable = persistence.isWritable(file);
    boolean upToDateWritable = attributes.isWritable();
    if (LOG_ATTRIBUTES.isDebugEnabled()) {
      LOG_ATTRIBUTES.debug("file=" + file + " writable vfs=" + file.isWritable() + " persistence=" + currentWritable + " real=" + upToDateWritable);
    }
    if (currentWritable != upToDateWritable) {
      scheduleAttributeChange(file, VirtualFile.PROP_WRITABLE, currentWritable, upToDateWritable);
    }

    if (SystemInfo.isWindows) {
      boolean currentHidden = file.is(VFileProperty.HIDDEN);
      boolean upToDateHidden = attributes.isHidden();
      if (currentHidden != upToDateHidden) {
        scheduleAttributeChange(file, VirtualFile.PROP_HIDDEN, currentHidden, upToDateHidden);
      }
    }

    if (attributes.isSymLink()) {
      String currentTarget = file.getCanonicalPath();
      String upToDateTarget = fs.resolveSymLink(file);
      String upToDateVfsTarget = upToDateTarget != null ? FileUtil.toSystemIndependentName(upToDateTarget) : null;
      if (!Comparing.equal(currentTarget, upToDateVfsTarget)) {
        scheduleAttributeChange(file, VirtualFile.PROP_SYMLINK_TARGET, currentTarget, upToDateVfsTarget);
      }
    }

    if (myIsRecursive || !file.isDirectory()) {
      file.markClean();
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:77,代码来源:RefreshWorker.java


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