@Override
  public @Nullable PsiFileSystemItem resolveFileReference(@NotNull FileReference reference, @NotNull String name) {
    VirtualFile file = getVirtualFile();
    if (!(file instanceof HttpVirtualFile)) {
      return null;
    }

    VirtualFile parent = file;
    if (!parent.isDirectory()) {
      parent = parent.getParent();
      if (parent == null) {
        parent = file;
      }
    }

    VirtualFile childFile = parent.findChild(name);
    HttpFileSystem fileSystem = (HttpFileSystem)parent.getFileSystem();
    if (childFile == null) {
      childFile = fileSystem.createChild(parent, name, !reference.isLast());
    }
    if (childFile.isDirectory()) {
      // pre create children
      VirtualFile childParent = childFile;
      FileReference[] references = reference.getFileReferenceSet().getAllReferences();
      for (int i = reference.getIndex() + 1, n = references.length; i < n; i++) {
        FileReference childReference = references[i];
        childParent = fileSystem.createChild(childParent, childReference.decode(childReference.getText()), i != (n - 1));
      }
      return getManager().findDirectory(childFile);
    }
    else {
      return getManager().findFile(childFile);
    }
  }
@Override
  public @Nullable PsiFileSystemItem resolveFileReference(@NotNull FileReference reference, @NotNull String name)