Package org.apache.jackrabbit.vault.fs.spi

Examples of org.apache.jackrabbit.vault.fs.spi.CNDReader


                } else if (ext.equals(".cnd")) {
                    if (opts.getCndPattern().matcher(repoPath).matches()) {
                        InputStream in = is.getByteStream();
                        try {
                            Reader r = new InputStreamReader(in, "utf8");
                            CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                            // provide session namespaces
                            reader.read(r, is.getSystemId(), new NamespaceMapping(resolver));
                            nodeTypes.add(reader);
                            log.debug("Loaded nodetypes from {}.", repoPath);
                        } catch (IOException e1) {
                            log.error("Error while reading CND.", e1);
                        } finally {
View Full Code Here


                    inf.setHasDefinition(true);
                    log.debug("Contains package definition {}.", path);
                } else if (name.endsWith(".cnd")) {
                    try {
                        Reader r = new InputStreamReader(new CloseShieldInputStream(zin), "utf8");
                        CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                        reader.read(r, entry.getName(), null);
                        inf.getNodeTypes().add(reader);
                        log.debug("Loaded nodetypes from {}.", path);
                    } catch (IOException e1) {
                        log.error("Error while reading CND: {}", e1.toString());
                        if (strict) {
View Full Code Here

                        inf.setHasDefinition(true);
                        log.debug("Contains package definition {}.", path);
                    } else if (name.endsWith(".cnd")) {
                        try {
                            Reader r = new InputStreamReader(new ByteArrayInputStream(data), "utf8");
                            CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                            reader.read(r, entry.getName(), null);
                            inf.getNodeTypes().add(reader);
                            log.debug("Loaded nodetypes from {}.", path);
                        } catch (IOException e1) {
                            log.error("Error while reading CND: {}", e1.toString());
                        }
View Full Code Here

                inf.setHasDefinition(true);
                log.info("Contains package definition {}.", src.getSystemId());
            } else if (name.endsWith(".cnd")) {
                try {
                    Reader r = new InputStreamReader(src.getByteStream(), "utf8");
                    CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                    reader.read(r, entry.getName(), null);
                    inf.getNodeTypes().add(reader);
                    log.info("Loaded nodetypes from {}.", src.getSystemId());
                } catch (IOException e1) {
                    log.error("Error while reading CND: {}", e1.toString());
                    if (strict) {
View Full Code Here

                } else if (ext.equals(".cnd")) {
                    if (opts.getCndPattern().matcher(repoPath).matches()) {
                        InputStream in = is.getByteStream();
                        try {
                            Reader r = new InputStreamReader(in, "utf8");
                            CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                            // provide session namespaces
                            reader.read(r, is.getSystemId(), new NamespaceMapping(resolver));
                            nodeTypes.add(reader);
                            log.debug("Loaded nodetypes from {}.", repoPath);
                        } catch (IOException e1) {
                            log.error("Error while reading CND.", e1);
                        } finally {
View Full Code Here

        }
        InputStream in = getClass().getClassLoader()
                .getResourceAsStream(DEFAULT_NODETYPES);
        try {
            NodeTypeInstaller installer = ServiceProviderFactory.getProvider().getDefaultNodeTypeInstaller(session);
            CNDReader types = ServiceProviderFactory.getProvider().getCNDReader();
            types.read(new InputStreamReader(in, "utf8"), DEFAULT_NODETYPES, null);
            installer.install(null, types);
        } catch (Exception e) {
            throw new RepositoryException("Error while importing nodetypes.", e);
        } finally {
            IOUtils.closeQuietly(in);
View Full Code Here

            in = getClass().getResourceAsStream(DEFAULT_NODETYPES);
            if (in == null) {
                throw new InternalError("Could not load " + DEFAULT_NODETYPES + " resource.");
            }
            NodeTypeInstaller installer = ServiceProviderFactory.getProvider().getDefaultNodeTypeInstaller(session);
            CNDReader types = ServiceProviderFactory.getProvider().getCNDReader();
            types.read(new InputStreamReader(in, "utf8"), DEFAULT_NODETYPES, null);
            installer.install(null, types);
        } catch (Throwable e) {
            log.warn("Error while registering nodetypes. Package installation might not work correctly.", e);
        } finally {
            IOUtils.closeQuietly(in);
View Full Code Here

        for (File file: metaDir.listFiles()) {
            if (file.getName().endsWith(".cnd")) {
                Reader r = null;
                try {
                    r = new InputStreamReader(new FileInputStream(file), "utf8");
                    CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                    reader.read(r, file.getName(), null);
                    cnds.add(reader);
                } catch (IOException e) {
                    log.error("Error while reading CND: {}", e.toString());
                    IOException io = new IOException("Error while reading CND.");
                    io.initCause(e);
View Full Code Here

                inf.setHasDefinition(true);
                log.info("Contains package definition {}.", src.getSystemId());
            } else if (name.endsWith(".cnd")) {
                try {
                    Reader r = new InputStreamReader(src.getByteStream(), "utf8");
                    CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                    reader.read(r, entry.getName(), null);
                    inf.getNodeTypes().add(reader);
                    log.info("Loaded nodetypes from {}.", src.getSystemId());
                } catch (IOException e1) {
                    log.error("Error while reading CND: {}", e1.toString());
                    if (strict) {
View Full Code Here

                } else if (ext.equals(".cnd")) {
                    if (opts.getCndPattern().matcher(repoPath).matches()) {
                        InputStream in = is.getByteStream();
                        try {
                            Reader r = new InputStreamReader(in, "utf8");
                            CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                            // provide session namespaces
                            reader.read(r, is.getSystemId(), new NamespaceMapping(resolver));
                            nodeTypes.add(reader);
                            log.debug("Loaded nodetypes from {}.", repoPath);
                        } catch (IOException e1) {
                            log.error("Error while reading CND.", e1);
                        } finally {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.vault.fs.spi.CNDReader

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.