本文整理匯總了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());
}