use of org.nuxeo.ecm.webengine.model.WebContext in project nuxeo-filesystem-connectors by nuxeo.
the class AbstractBackendFactory method getBackend.
@Override
public Backend getBackend(String path, HttpServletRequest request) {
if (request == null) {
throw new NullPointerException("null request");
}
Backend backend = (Backend) request.getAttribute(WIRequestFilter.BACKEND_KEY);
if (backend == null) {
// create backend from WebEngine session
WebContext webContext = WebEngine.getActiveContext();
if (webContext == null) {
throw new NullPointerException("null WebContext");
}
CoreSession session = webContext.getCoreSession();
if (session == null) {
throw new NullPointerException("null CoreSession");
}
backend = createRootBackend(session);
request.setAttribute(WIRequestFilter.BACKEND_KEY, backend);
}
return backend.getBackend(path);
}
Aggregations