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


Java ArchiveVfsUtil.getJarRootForLocalFile方法代码示例

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


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

示例1: doTest

import consulo.vfs.util.ArchiveVfsUtil; //导入方法依赖的package包/类
private void doTest(boolean annotateLocalVariables) throws Exception  {
  final String nullityPath = "/codeInsight/nullityinferrer";
  final VirtualFile aLib = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + nullityPath + "/lib/annotations.jar");
  if (aLib != null) {
    final VirtualFile file = ArchiveVfsUtil.getJarRootForLocalFile(aLib);
    if (file != null) {
      ModuleRootModificationUtil.addModuleLibrary(myModule, file.getUrl());
    }
  }

  configureByFile(nullityPath + "/before" + getTestName(false) + ".java");
  final NullityInferrer nullityInferrer = new NullityInferrer(annotateLocalVariables, getProject());
  nullityInferrer.collect(getFile());
  nullityInferrer.apply(getProject());
  checkResultByFile(nullityPath + "/after" + getTestName(false)+ ".java");
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:NullityInferrerTest.java

示例2: getBaseJarUrl

import consulo.vfs.util.ArchiveVfsUtil; //导入方法依赖的package包/类
@LuaMethod(name="getBaseJarUrl", global = true)
public String getBaseJarUrl() {
    String url = VfsUtil.pathToUrl(PathUtil.getJarPathForClass(LuaPsiFile.class));
    VirtualFile sdkFile = VirtualFileManager.getInstance().findFileByUrl(url);
    if (sdkFile != null) {
        VirtualFile jarFile = ArchiveVfsUtil.getJarRootForLocalFile(sdkFile);
        if (jarFile != null) {
            return jarFile.getUrl();
        } else {
            return sdkFile.getUrl();
        }
    }

    return null;
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:16,代码来源:KahluaPluginDocumentationProvider.java

示例3: getJarFromLibDirectory

import consulo.vfs.util.ArchiveVfsUtil; //导入方法依赖的package包/类
private static VirtualFile getJarFromLibDirectory(final String relativePath) {
  final File file = PathManager.findFileInLibDirectory(relativePath);
  final VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(file);
  Assert.assertNotNull(file.getAbsolutePath() + " not found", virtualFile);
  final VirtualFile jarRoot = ArchiveVfsUtil.getJarRootForLocalFile(virtualFile);
  Assert.assertNotNull(jarRoot);
  return jarRoot;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:PackagingElementsTestCase.java

示例4: getJarFromLibDir

import consulo.vfs.util.ArchiveVfsUtil; //导入方法依赖的package包/类
protected VirtualFile getJarFromLibDir(final String name) {
  final VirtualFile file = getVirtualFile(PathManager.findFileInLibDirectory(name));
  assertNotNull(name + " not found", file);
  final VirtualFile jarFile = ArchiveVfsUtil.getJarRootForLocalFile(file);
  assertNotNull(name + " is not jar", jarFile);
  return jarFile;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:ModuleRootManagerTestCase.java

示例5: isValidXalanPresent

import consulo.vfs.util.ArchiveVfsUtil; //导入方法依赖的package包/类
@Nullable
private static Boolean isValidXalanPresent(SimpleJavaParameters parameters)
{
	final List<VirtualFile> files = parameters.getClassPath().getVirtualFiles();
	for(VirtualFile file : files)
	{
		if(file.getName().matches(".*xalan.*\\.jar"))
		{
			final VirtualFile root = ArchiveVfsUtil.getJarRootForLocalFile(file);
			final VirtualFile manifestFile = root != null ? root.findFileByRelativePath("META-INF/MANIFEST.MF") : null;
			if(manifestFile != null)
			{
				try
				{
					Manifest manifest = manifestFile.getUserData(MANIFEST);
					if(manifest == null)
					{
						manifest = new Manifest(manifestFile.getInputStream());
						manifestFile.putUserData(MANIFEST, manifest);
					}
					Attributes attributes = manifest.getAttributes("org/apache/xalan/");
					if(attributes == null)
					{
						attributes = manifest.getAttributes("org/apache/xalan");
					}
					if(attributes == null)
					{
						LOG.info("No manifest attributes for 'org/apache/xalan/' in " + manifestFile.getPresentableUrl());
						continue;
					}
					final String version = attributes.getValue("Implementation-Version");
					if(version != null)
					{
						final String[] parts = version.split("\\.");
						if(parts.length >= 2)
						{
							if(Integer.parseInt(parts[0]) >= 2 && Integer.parseInt(parts[1]) >= 6)
							{
								return true;
							}
						}
						LOG.info("Unsupported Xalan version: " + version);
					}
					else
					{
						LOG.info("No Xalan version information in " + file.getPath());
					}
				}
				catch(IOException e)
				{
					LOG.warn("Unable to read manifest from " + file.getName(), e);
				}
			}
			else
			{
				LOG.info("No manifest file in " + file.getPath());
			}
			return false;
		}
	}

	return null;
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:64,代码来源:XsltDebuggerExtension.java


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