本文整理汇总了Java中com.intellij.openapi.application.PathManager.findFileInLibDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java PathManager.findFileInLibDirectory方法的具体用法?Java PathManager.findFileInLibDirectory怎么用?Java PathManager.findFileInLibDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.application.PathManager
的用法示例。
在下文中一共展示了PathManager.findFileInLibDirectory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBundledAnt
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
public static AntInstallation createBundledAnt() {
AntInstallation bundledAnt = new AntInstallation() {
@Override
public AntReference getReference() {
return AntReference.BUNDLED_ANT;
}
};
AntInstallation.NAME.set(bundledAnt.getProperties(), BUNDLED_ANT_NAME);
final File antHome = PathManager.findFileInLibDirectory(ANT_FILE);
AntInstallation.HOME_DIR.set(bundledAnt.getProperties(), antHome.getAbsolutePath());
ArrayList<AntClasspathEntry> classpath = AntInstallation.CLASS_PATH.getModifiableList(bundledAnt.getProperties());
File antLibDir = new File(antHome, LIB_DIR);
classpath.add(new AllJarsUnderDirEntry(antLibDir));
bundledAnt.updateVersion(new File(antLibDir, ANT_JAR_FILE_NAME));
return bundledAnt;
}
示例2: getJarFromLibDirectory
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
private static VirtualFile getJarFromLibDirectory(final String relativePath) {
final File file = PathManager.findFileInLibDirectory(relativePath);
final VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(file);
assertNotNull(file.getAbsolutePath() + " not found", virtualFile);
final VirtualFile jarRoot = JarFileSystem.getInstance().getJarRootForLocalFile(virtualFile);
assertNotNull(jarRoot);
return jarRoot;
}
示例3: getJUnitJarPath
import com.intellij.openapi.application.PathManager; //导入方法依赖的package包/类
protected static String getJUnitJarPath() {
final File file = PathManager.findFileInLibDirectory("junit.jar");
assertTrue("File " + file.getAbsolutePath() + " doesn't exist", file.exists());
return FileUtil.toSystemIndependentName(file.getAbsolutePath());
}