public Session getSession()

in src/main/java/org/apache/sling/jcr/webdav/impl/helper/SlingSessionProvider.java [52:68]


    public Session getSession(HttpServletRequest request, Repository rep,
            String workspace) throws LoginException {

        // we do not accept the anonymous session for WebDAV !
        if (request.getAuthType() == null) {
            throw new LoginException("Authentication required for WebDAV");
        }

        // otherwise return the session from the request attribute
        ResourceResolver resourceResolver = (ResourceResolver)
            request.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);

        if (resourceResolver == null) {
            return null;
        }
        return resourceResolver.adaptTo(Session.class);
    }