本文整理汇总了Java中com.intellij.openapi.roots.impl.libraries.LibraryImpl.collectJarFiles方法的典型用法代码示例。如果您正苦于以下问题:Java LibraryImpl.collectJarFiles方法的具体用法?Java LibraryImpl.collectJarFiles怎么用?Java LibraryImpl.collectJarFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.roots.impl.libraries.LibraryImpl
的用法示例。
在下文中一共展示了LibraryImpl.collectJarFiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFiles
import com.intellij.openapi.roots.impl.libraries.LibraryImpl; //导入方法依赖的package包/类
@Override
public VirtualFile[] getFiles(OrderRootType rootType) {
List<VirtualFile> result = new ArrayList<VirtualFile>();
for (LightFilePointer pointer : myRoots.get(rootType)) {
final VirtualFile file = pointer.getFile();
if (file == null) {
continue;
}
if (file.isDirectory()) {
final String url = file.getUrl();
if (myJarDirectories.contains(rootType, url)) {
LibraryImpl.collectJarFiles(file, result, myJarDirectories.isRecursive(rootType, url));
continue;
}
}
result.add(file);
}
return VfsUtil.toVirtualFileArray(result);
}
示例2: getFiles
import com.intellij.openapi.roots.impl.libraries.LibraryImpl; //导入方法依赖的package包/类
@NotNull
@Override
public VirtualFile[] getFiles(@NotNull OrderRootType rootType) {
final VirtualFilePointerContainer container = myRoots.get(rootType);
if (container == null) return VirtualFile.EMPTY_ARRAY;
final List<VirtualFile> expanded = new ArrayList<VirtualFile>();
for (JpsLibraryRoot root : myJpsLibrary.getRoots(getJpsRootType(rootType))) {
final VirtualFilePointer pointer = container.findByUrl(root.getUrl());
if (pointer == null) continue;
VirtualFile file = pointer.getFile();
if (file == null) continue;
if (file.isDirectory() && root.getInclusionOptions() != JpsLibraryRoot.InclusionOptions.ROOT_ITSELF) {
LibraryImpl.collectJarFiles(file, expanded, root.getInclusionOptions() == JpsLibraryRoot.InclusionOptions.ARCHIVES_UNDER_ROOT_RECURSIVELY);
continue;
}
expanded.add(file);
}
return VfsUtilCore.toVirtualFileArray(expanded);
}