Replaced Usage of PathUtil.jarFileToVirtualFile() to PathUtil.jarFileOrDirectoryToVirtualFile(), removed the former.

This commit is contained in:
Evgeny Gerashchenko
2012-05-17 20:16:55 +04:00
parent 74a63c9b9d
commit bf62877e2b
2 changed files with 2 additions and 10 deletions
@@ -85,7 +85,7 @@ public class CompilerDependencies {
@NotNull
public List<VirtualFile> getJdkHeaderRoots() {
if (compilerSpecialMode.includeJdkHeaders()) {
return Collections.singletonList(PathUtil.jarFileToVirtualFile(jdkHeadersJar));
return Collections.singletonList(PathUtil.jarFileOrDirectoryToVirtualFile(jdkHeadersJar));
}
else {
return Collections.emptyList();
@@ -95,7 +95,7 @@ public class CompilerDependencies {
@NotNull
public List<VirtualFile> getRuntimeRoots() {
if (compilerSpecialMode.includeKotlinRuntime()) {
return Collections.singletonList(PathUtil.jarFileToVirtualFile(runtimeJar));
return Collections.singletonList(PathUtil.jarFileOrDirectoryToVirtualFile(runtimeJar));
}
else {
return Collections.emptyList();
@@ -118,14 +118,6 @@ public class PathUtil {
return roots;
}
@NotNull
public static VirtualFile jarFileToVirtualFile(@NotNull File file) {
if (!file.exists() || !file.isFile()) {
throw new IllegalStateException("file must exist and be regular to be converted to virtual file: " + file);
}
return VirtualFileManager.getInstance().findFileByUrl("jar://" + file.getPath() + "!/");
}
@NotNull
public static VirtualFile jarFileOrDirectoryToVirtualFile(@NotNull File file) {
if (file.exists()) {