本文整理汇总了Java中com.intellij.util.PathUtil.getLocalFile方法的典型用法代码示例。如果您正苦于以下问题:Java PathUtil.getLocalFile方法的具体用法?Java PathUtil.getLocalFile怎么用?Java PathUtil.getLocalFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.PathUtil
的用法示例。
在下文中一共展示了PathUtil.getLocalFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contains
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
@Override
public boolean contains(@NotNull VirtualFile file) {
final PsiDirectory value = getValue();
if (value == null) {
return false;
}
VirtualFile directory = value.getVirtualFile();
if (directory.getFileSystem() instanceof LocalFileSystem) {
file = PathUtil.getLocalFile(file);
}
if (!VfsUtilCore.isAncestor(directory, file, false)) {
return false;
}
if (Registry.is("ide.hide.excluded.files")) {
final Project project = value.getProject();
final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
return !fileIndex.isExcluded(file);
}
else {
return !FileTypeRegistry.getInstance().isFileIgnored(file);
}
}
示例2: getLocalFile
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
/**
* @return the local file
*/
@Nullable
public VirtualFile getLocalFile() {
VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(myUrl);
if (file != null) {
file = PathUtil.getLocalFile(file);
}
return file;
}
示例3: getAntObjects
import com.intellij.util.PathUtil; //导入方法依赖的package包/类
private static Map<String, Class> getAntObjects(final GroovyFile groovyFile) {
final Project project = groovyFile.getProject();
final Module module = ModuleUtil.findModuleForPsiElement(groovyFile);
Set<VirtualFile> jars = new HashSet<VirtualFile>();
if (module != null) {
ContainerUtil.addAll(jars, OrderEnumerator.orderEntries(module).getAllLibrariesAndSdkClassesRoots());
}
if (groovyFile.isScript() && GroovyScriptUtil.getScriptType(groovyFile) instanceof GantScriptType) {
jars.addAll(GantScriptType.additionalScopeFiles(groovyFile));
}
final ArrayList<URL> urls = new ArrayList<URL>();
for (VirtualFile jar : jars) {
VirtualFile localFile = PathUtil.getLocalFile(jar);
if (localFile.getFileSystem() instanceof LocalFileSystem) {
urls.add(VfsUtilCore.convertToURL(localFile.getUrl()));
}
}
AntClassLoader loader;
synchronized (ourLock) {
final Map<List<URL>, AntClassLoader> map = CachedValuesManager.getManager(project).getParameterizedCachedValue(project, KEY,
PROVIDER, false, project);
loader = map.get(urls);
if (loader == null) {
map.put(urls, loader = new AntClassLoader(urls));
}
}
return loader.getAntObjects();
}