mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ability to get mock fs root — findFileByPath("") must returns root
This commit is contained in:
@@ -36,9 +36,8 @@ public class MockVirtualFileSystem extends DeprecatedVirtualFileSystem {
|
||||
path = path.replace(File.separatorChar, '/');
|
||||
path = path.replace('/', ':');
|
||||
if (StringUtil.startsWithChar(path, ':')) path = path.substring(1);
|
||||
String[] components = path.split(":");
|
||||
MyVirtualFile file = myRoot;
|
||||
for (String component : components) {
|
||||
for (String component : StringUtil.split(path, ":")) {
|
||||
file = file.getOrCreate(component);
|
||||
}
|
||||
return file;
|
||||
|
||||
Reference in New Issue
Block a user