Package javax.jcr

Examples of javax.jcr.GuestCredentials


        this.repository = repository;
        this.batchReadConfig = batchReadConfig;
        this.supportsObservation = "true".equals(repository.getDescriptor(Repository.OPTION_OBSERVATION_SUPPORTED));

        try {
            Session s = repository.login(new GuestCredentials());
            ValueFactory vf = s.getValueFactory();
            if (vf instanceof ValueFactoryQImpl) {
                qValueFactory = ((ValueFactoryQImpl) vf).getQValueFactory();
            }
        } catch (RepositoryException e) {
View Full Code Here


        return repository;
    }

    @Override
    public Credentials getReadOnlyCredentials() {
        return new GuestCredentials();
    }
View Full Code Here

                if (defaultHeaderValue == null) {
                    throw new LoginException();
                } else if (EMPTY_DEFAULT_HEADER_VALUE.equals(defaultHeaderValue)) {
                    return null;
                } else if (GUEST_DEFAULT_HEADER_VALUE.equals(defaultHeaderValue)) {
                    return new GuestCredentials();
                } else {
                    int pos = defaultHeaderValue.indexOf(':');
                    if (pos < 0) {
                        return new SimpleCredentials(defaultHeaderValue, new char[0]);
                    } else {
View Full Code Here

        this.repository = repository;
        this.batchReadConfig = batchReadConfig;
        this.supportsObservation = "true".equals(repository.getDescriptor(Repository.OPTION_OBSERVATION_SUPPORTED));

        try {
            Session s = repository.login(new GuestCredentials());
            ValueFactory vf = s.getValueFactory();
            if (vf instanceof ValueFactoryQImpl) {
                qValueFactory = ((ValueFactoryQImpl) vf).getQValueFactory();
            }
        } catch (RepositoryException e) {
View Full Code Here

        }
        return adminSession;
    }

    protected Session createAnonymousSession() throws RepositoryException {
        return getRepository().login(new GuestCredentials());
    }
View Full Code Here

        return repository;
    }

    @Override
    public Credentials getReadOnlyCredentials() {
        return new GuestCredentials();
    }
View Full Code Here

    }

    @Test(expected = NoSuchWorkspaceException.class)
    public void loginInvalidWorkspace() throws RepositoryException {
        Repository repository = getRepository();
        repository.login(new GuestCredentials(), "invalid");
    }
View Full Code Here

    }

    @Test
    public void testRegisterPrivilegeWithReadOnly() throws RepositoryException {
        try {
            getPrivilegeManager(new GuestCredentials()).registerPrivilege("test", true, new String[0]);
            fail("Only admin is allowed to register privileges.");
        } catch (AccessDeniedException e) {
            // success
        }
    }
View Full Code Here

    protected ContentSession createAdminSession() throws LoginException, NoSuchWorkspaceException {
        return getContentRepository().login(getAdminCredentials(), null);
    }

    protected ContentSession createGuestSession() throws LoginException, NoSuchWorkspaceException {
        return getContentRepository().login(new GuestCredentials(), null);
    }
View Full Code Here

    @Override
    protected void service(
            HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        try {
            ContentSession session = repository.login(new GuestCredentials(), null);
            try {
                Root root = session.getLatestRoot();
                Tree tree = root.getTree(request.getPathInfo());
                request.setAttribute("root", root);
                request.setAttribute("tree", tree);
View Full Code Here

TOP

Related Classes of javax.jcr.GuestCredentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.