Examples of RepositoryException


Examples of javax.jcr.RepositoryException

     */
    public static final String PARAM_ITEMINFO_CACHE_SIZE = "org.apache.jackrabbit.spi2dav.ItemInfoCacheSize";

    public RepositoryService createRepositoryService(Map<?, ?> parameters) throws RepositoryException {
        if (parameters == null) {
            throw new RepositoryException("Parameter " + PARAM_REPOSITORY_URI + " missing");
        }

        String uri;
        if (parameters.get(PARAM_REPOSITORY_URI) == null) {
            throw new RepositoryException("Parameter " + PARAM_REPOSITORY_URI + " missing");
        }
        else {
            uri = parameters.get(PARAM_REPOSITORY_URI).toString();
        }

View Full Code Here

Examples of javax.jcr.RepositoryException

                    return random.read(b);
                } finally {
                    random.close();
                }
            } catch (FileNotFoundException e) {
                throw new RepositoryException("Binary file is missing", e);
            } catch (IOException e) {
                throw new RepositoryException("Unable to read the binary", e);
            }
        } else {
            throw new IllegalStateException("This binary has been disposed");
        }
    }
View Full Code Here

Examples of javax.jcr.RepositoryException

            return new ByteArrayInputStream(data);
        } else if (file != null) {
            try {
                return new FileInputStream(file);
            } catch (FileNotFoundException e) {
                throw new RepositoryException("Binary file is missing", e);
            }
        } else {
            throw new IllegalStateException("This binary has been disposed");
        }
    }
View Full Code Here

Examples of javax.jcr.RepositoryException

                        throw new SAXException("XML import failed", e);
                    }
                }
            };
        } catch (SAXException e) {
            throw new RepositoryException("XML serialization failed", e);
        }
    }
View Full Code Here

Examples of javax.jcr.RepositoryException

        throws ItemExistsException, NoSuchNodeTypeException, RepositoryException {
        // src must not be ancestor of destination
        if (srcPath.isAncestorOf(destPath)) {
            String msg = "Invalid destination path: cannot be descendant of source path (" + LogUtil.safeGetJCRPath(destPath, resolver) + "," + LogUtil.safeGetJCRPath(srcPath, resolver) + ")";
            log.debug(msg);
            throw new RepositoryException(msg);
        }

        // destination must not contain an index
        int index = destPath.getIndex();
        if (index != Path.INDEX_UNDEFINED) {
            // subscript in name element
            String msg = "Invalid destination path: subscript in name element is not allowed (" + LogUtil.safeGetJCRPath(destPath, resolver) + ")";
            log.debug(msg);
            throw new RepositoryException(msg);
        }
        // root node cannot be moved:
        if (srcPath.denotesRoot() || destPath.denotesRoot()) {
            String msg = "Cannot move the root node.";
            log.debug(msg);
            throw new RepositoryException(msg);
        }

        NodeState srcState = getNodeState(srcPath, hierMgr);
        NodeState srcParentState = getNodeState(srcPath.getAncestor(1), hierMgr);
        NodeState destParentState = getNodeState(destPath.getAncestor(1), hierMgr);
View Full Code Here

Examples of javax.jcr.RepositoryException

                                 NameFactory nameFactory,
                                 PathFactory pathFactory,
                                 QValueFactory qValueFactory,
                                 int itemInfoCacheSize) throws RepositoryException {
        if (uri == null || "".equals(uri)) {
            throw new RepositoryException("Invalid repository uri '" + uri + "'.");
        }

        if (idFactory == null || qValueFactory == null) {
            throw new RepositoryException("IdFactory and QValueFactory may not be null.");
        }
        this.idFactory = idFactory;
        this.nameFactory = nameFactory;
        this.pathFactory = pathFactory;
        this.qValueFactory = qValueFactory;
        this.itemInfoCacheSize = itemInfoCacheSize;

        try {
            domFactory = DomUtil.createDocument();
        } catch (ParserConfigurationException e) {
            throw new RepositoryException(e);
        }

        try {
            URI repositoryUri = new URI((uri.endsWith("/")) ? uri : uri+"/", true);
            hostConfig = new HostConfiguration();
            hostConfig.setHost(repositoryUri);

            nsCache = new NamespaceCache();
            uriResolver = new URIResolverImpl(repositoryUri, this, domFactory);
            NamePathResolver resolver = new NamePathResolverImpl(nsCache);
            valueFactory = new ValueFactoryQImpl(qValueFactory, resolver);

        } catch (URIException e) {
            throw new RepositoryException(e);
        }
        connectionManager = new MultiThreadedHttpConnectionManager();
    }
View Full Code Here

Examples of javax.jcr.RepositoryException

        connectionManager = new MultiThreadedHttpConnectionManager();
    }

    private static void checkSessionInfo(SessionInfo sessionInfo) throws RepositoryException {
        if (!(sessionInfo instanceof SessionInfoImpl)) {
            throw new RepositoryException("Unknown SessionInfo implementation.");
        }
    }
View Full Code Here

Examples of javax.jcr.RepositoryException

        }
    }

    private static void checkSubscription(Subscription subscription) throws RepositoryException {
        if (!(subscription instanceof EventSubscriptionImpl)) {
            throw new RepositoryException("Unknown Subscription implementation.");
        }
    }
View Full Code Here

Examples of javax.jcr.RepositoryException

            // the jcr:name property does not provide the value in escaped form.
            String jcrName = nameProp.getValue().toString();
            try {
                return resolver.getQName(jcrName);
            } catch (NameException e) {
                throw new RepositoryException(e);
            }
        } else {
            return NameConstants.ROOT;
        }
    }
View Full Code Here

Examples of javax.jcr.RepositoryException

            getClient(sessionInfo).executeMethod(method);
            method.checkSuccess();

        } catch (IOException e) {
            throw new RepositoryException(e);
        } catch (DavException e) {
            throw ExceptionConverter.generate(e, method);
        } finally {
            if (method != null) {
                method.releaseConnection();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.