You should adapt ResourceResolver
directly to a Session
. Then get a node by the identifier. There is no way to create Resource
from the Node
, so use Node
path and get the Resource
from the ResourceResolver
:
Session jcrSession = resourceResolver.adaptTo(Session.class);
Node node = jcrSession.getNodeByIdentifier(eventId);
Resource resource = resourceResolver.getResource(node.getPath());