コード例 #1
0
 private void scanLibrary(String libraryName, VirtualFile dir) {
   Collection<VirtualFile> children = dir.getChildren();
   for (VirtualFile child : children) {
     if (child.isFile()) {
       resources.add(new ResourceKey(child.getName(), libraryName));
     } else {
       VirtualFile resource = ResourceUtil.getLatestVersion(child, false);
       if (resource != null) {
         resources.add(new ResourceKey(child.getName(), libraryName));
       }
     }
   }
 }
コード例 #2
0
  private void scanResourcesRoot(VirtualFile file) {
    if (file == null) {
      return;
    }

    Collection<VirtualFile> children = file.getChildren();
    for (VirtualFile child : children) {
      if (child.isFile()) {
        resources.add(ResourceKey.create(child.getName()));
      } else {
        String libraryName = child.getName();
        VirtualFile libraryDir = ResourceUtil.getLatestVersion(child, true);
        if (libraryDir != null) {
          scanLibrary(libraryName, libraryDir);
        }
      }
    }
  }