org.openide.filesystems.FileUtil.refreshFor()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.openide.filesystems.FileUtil.refreshFor()方法的一些代码示例,展示了FileUtil.refreshFor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.refreshFor()方法的具体详情如下:
包路径:org.openide.filesystems.FileUtil
类名称:FileUtil
方法名:refreshFor

FileUtil.refreshFor介绍

[英]Refreshes all necessary filesystems. Not all instances of FileObject are refreshed but just those that represent passed files and their children recursively.
[中]刷新所有必要的文件系统。并非所有FileObject的实例都会刷新,只是那些表示递归传递的files及其子对象的实例才会刷新。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

public void run() {
    LOG.fine("refreshAll - started");  //NOI18N
    refreshFor(File.listRoots());
    try {
      getConfigRoot().getFileSystem().refresh(true);
    } catch (FileStateInvalidException ex) {
      Exceptions.printStackTrace(ex);
    } finally {
      LOG.fine("refreshAll - finished");  //NOI18N
      synchronized (REFRESH_RP) {
        refreshTask = null;
      }
    }
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

@Override
  public void run() {
    FileUtil.refreshFor(files.toArray(new File[files.size()]));
  }
}, 100);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

@Override
  public void run() {
    final File[] array = files.toArray(new File[files.size()]);
    if (array.length > 0) {
      FileUtil.refreshFor(array);
    }
    if (!fileObjects.isEmpty()) {
      for (FileObject fo : fileObjects) {
        FileSystemProvider.scheduleRefresh(fo);
      }
    }
  }
};

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep

@Override
  public void run() {
    FileUtil.refreshFor(targetDir);
    UiUtils.refreshCssInBrowser(target);
  }
}), "Compiling sass files..."); // NOI18N

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

@Override
  public void run() {
    for (FileObject dir : dirs) {
      FileUtil.refreshFor(FileUtil.toFile(dir));
    }
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep

@Override
  public void run() {
    FileUtil.refreshFor(targetDir);
    UiUtils.refreshCssInBrowser(target);
  }
}), "Compiling less files..."); // NOI18N

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-project

public void run() {
    if (original != null) {
      original.run();
    }
    FileUtil.refreshFor(FileUtil.toFile(project.getProjectDirectory()));
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-framework

private void refresh(FileObject fo) {
    if (fo == null) {
      return;
    }
    File file = FileUtil.toFile(fo);
    if (file != null) {
      FileUtil.refreshFor(file);
    } else {
      // just defensive fallback
      fo.refresh();
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-groovy-grailsproject

public void run() {
  FileObject fo = project.getProjectDirectory();
  File file = FileUtil.toFile(fo);
  if (file != null) {
    FileUtil.refreshFor(file);
  } else {
    // just defensive fallback
    fo.refresh();
  }
}

代码示例来源:origin: dcaoyuan/nbscala

visitor.setOutputListener(new CompileAnnotation(clazzfile, lineNum,
    text), true); 
FileUtil.refreshFor(clazzfile);
FileObject file = FileUtil.toFileObject(clazzfile);
String newclazz = clazz;

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-testng-maven

private FileObject getFailedConfig() {
  FileObject fo = p.getProjectDirectory();
  //XXX - should rather listen on a fileobject??
  FileUtil.refreshFor(FileUtil.toFile(fo));
  FileObject cfg = fo.getFileObject(failedConfPath);
  if (cfg == null || !cfg.isValid()) {
    cfg = fo.getFileObject(failedConfPath2);
  }
  return cfg;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-groovy-grailsproject

FileUtil.refreshFor(project.getBuildConfig().getProjectPluginsDir());

代码示例来源:origin: org.codehaus.mevenide/nb-project

public void fireProjectReload() {
  oldProject = project;
  project = null;
  FileUtil.refreshFor(FileUtil.toFile(getProjectDirectory()));
  projectInfo.reset();
  problemReporter.clearReports();
  ACCESSOR.doFireReload(watcher);
  doBaseProblemChecks();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

if (parentFo == null) {
  parent.mkdirs();
  FileUtil.refreshFor(parent);
  parentFo = FileUtil.toFileObject(parent);

代码示例来源:origin: dcaoyuan/nbscala

FileUtil.refreshFor(clazzfile);
FileObject file = FileUtil.toFileObject(clazzfile);
if (file == null) {

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject

execution.run().get();
  FileUtil.refreshFor(FileUtil.toFile(gruntFile.getParent()));
} catch (InterruptedException ex) {
  Exceptions.printStackTrace(ex);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api

/**
 * All proxies should belong to the SAME FILE SYSTEM.
 * In other words, either have geFile() returning not null
 * or getFileObject().getFileSystem() return thr same value.
 */
public static void refreshFor(VCSFileProxy... proxies)  throws ConnectException, IOException {
  if (proxies.length == 0) {
    return;
  }        
  if (proxies[0].toFile() != null) {
    File[] files = new File[proxies.length];
    for (int i = 0; i < proxies.length; i++) {
      final File f = proxies[i].toFile();
      assert f != null;
      files[i] = f;
    }
    FileUtil.refreshFor(files);
  } else {
    FileSystem fs = getFileSystem(proxies[0]);
    String[] paths = new String[proxies.length];
    for (int i = 0; i < proxies.length; i++) {
      paths[i] = proxies[i].getPath();
      assert getFileSystem(proxies[i]) == fs;
    }
    refreshFor(fs, paths);
  }
}

相关文章