Package javax.jcr

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


    protected Reader getCndReader() throws RepositoryException {
        String resourceName = "default-nodetypes.cnd";
        InputStream is = AbstractJCR2SPITest.class.getResourceAsStream(resourceName);
        if (is == null) {
            throw new RepositoryException(("Resource not found: " + resourceName));
        }

        return new InputStreamReader(new BufferedInputStream(is));
    }
View Full Code Here

     */
    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

                    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

            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

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

        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

                                 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

        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

        }
    }

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

TOP

Related Classes of javax.jcr.RepositoryException

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.