Refresh local file system to update content of the jar

This commit is contained in:
Nikolay Krasko
2013-03-25 15:11:43 +04:00
parent 314efa3372
commit 2b8af4e6a5
@@ -187,9 +187,9 @@ public class KotlinRuntimeLibraryUtil {
return kotlinRuntimeJar;
}
static void replaceFile(File updatedFile, VirtualFile replacedFile) {
static void replaceFile(File updatedFile, VirtualFile replacedJarFile) {
try {
String localPath = com.intellij.util.PathUtil.getLocalPath(replacedFile);
String localPath = com.intellij.util.PathUtil.getLocalPath(replacedJarFile);
assert localPath != null;
File libraryJarPath = new File(localPath);
@@ -199,11 +199,14 @@ public class KotlinRuntimeLibraryUtil {
}
FileUtil.copy(updatedFile, libraryJarPath);
VirtualFile localFile = JarFileSystem.getInstance().getLocalVirtualFileFor(replacedJarFile);
if (localFile != null) {
localFile.refresh(false, true);
}
}
catch (IOException e) {
throw new AssertionError(e);
}
replacedFile.refresh(true, true);
}
}