mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] fixes JRT file system refresh on Windows
This commit is contained in:
@@ -111,7 +111,7 @@ public class JrtFileSystem extends ArchiveFileSystem {
|
||||
protected ArchiveHandler getHandler(@NotNull VirtualFile entryFile) {
|
||||
checkSubscription();
|
||||
|
||||
String homePath = extractLocalPath(extractRootPath(entryFile.getPath()));
|
||||
String homePath = FileUtil.toSystemIndependentName(extractLocalPath(extractRootPath(entryFile.getPath())));
|
||||
ArchiveHandler handler = myHandlers.get(homePath);
|
||||
if (handler == null) {
|
||||
handler = isSupported() ? new JrtHandler(homePath) : new JrtHandlerStub(homePath);
|
||||
|
||||
@@ -86,7 +86,10 @@ public class JrtFileSystemTest extends BareTestFixtureTestCase {
|
||||
assertThat(Stream.of(dir.getChildren()).map(VirtualFile::getName).collect(Collectors.toList())).containsOnly("pkg1");
|
||||
assertThat(myRoot.findFileByRelativePath("test/pkg2/Class2.class")).isNull();
|
||||
|
||||
Files.copy(myTestData.resolve("image2"), myTempDir.getRoot().toPath().resolve("lib/modules"), StandardCopyOption.REPLACE_EXISTING);
|
||||
Path modules = myTempDir.getRoot().toPath().resolve("lib/modules");
|
||||
Files.move(modules, myTempDir.getRoot().toPath().resolve("lib/modules.bak"));
|
||||
Files.copy(myTestData.resolve("image2"), modules, StandardCopyOption.REPLACE_EXISTING);
|
||||
|
||||
VirtualFile local = LocalFileSystem.getInstance().findFileByIoFile(myTempDir.getRoot());
|
||||
assertThat(local).isNotNull();
|
||||
local.refresh(false, true);
|
||||
|
||||
Reference in New Issue
Block a user