Package org.apache.jackrabbit.vault.fs.config

Examples of org.apache.jackrabbit.vault.fs.config.DefaultMetaInf


     */
    public void rewrap(ExportOptions opts, VaultPackage src, OutputStream out)
            throws IOException {
        MetaInf metaInf = opts.getMetaInf();
        if (metaInf == null) {
            metaInf = new DefaultMetaInf();
        }
        JarExporter exporter = new JarExporter(out);
        exporter.open();
        exporter.setProperties(metaInf.getProperties());
        ProgressTracker tracker = null;
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public MetaInf getMetaInf() throws RepositoryException {
        DefaultMetaInf inf = new DefaultMetaInf();
        inf.setFilter(readFilter());

        // add properties
        Properties props = new Properties();
        loadProperties(props);
        inf.setProperties(props);

        return inf;
    }
View Full Code Here

                new BufferedInputStream(
                        new FileInputStream(zipFile)
                )
        );
        numEntries = 0;
        inf = new DefaultMetaInf();
        try {
            ZipEntry entry;
            while ((entry = zin.getNextEntry()) != null) {
                numEntries++;
                String name = entry.getName();
View Full Code Here

            if (archiveRoot.hasNode(Constants.META_DIR)) {
                inf = loadMetaInf(
                        new JcrEntry(archiveRoot.getNode(Constants.META_DIR), Constants.META_DIR, true),
                        strict);
            } else {
                inf = new DefaultMetaInf();
                inf.setSettings(VaultSettings.createDefault());
                DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
                PathFilterSet filterSet = new PathFilterSet(rootPath);
                filter.add(filterSet);
                inf.setFilter(filter);
View Full Code Here

        }
    }

    private DefaultMetaInf loadMetaInf(Entry dir, boolean strict)
            throws IOException, ConfigurationException {
        DefaultMetaInf inf = new DefaultMetaInf();
        // filter
        for (Entry entry: dir.getChildren()) {
            String name = entry.getName();
            VaultInputSource src = getInputSource(entry);
            if (name.equals(Constants.FILTER_XML)) {
                // load filter
                inf.loadFilter(src.getByteStream(), src.getSystemId());
            } else if (name.equals(Constants.CONFIG_XML)) {
                // load config
                inf.loadConfig(src.getByteStream(), src.getSystemId());
            } else if (name.equals(Constants.SETTINGS_XML)) {
                // load settings
                inf.loadSettings(src.getByteStream(), src.getSystemId());
            } else if (name.equals(Constants.PROPERTIES_XML)) {
                // load properties
                inf.loadProperties(src.getByteStream(), src.getSystemId());
            } else if (name.equals(Constants.PRIVILEGES_XML)) {
                // load privileges
                inf.loadPrivileges(src.getByteStream(), src.getSystemId());
            } else if (name.equals(Constants.PACKAGE_DEFINITION_XML)) {
                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) {
                        throw e1;
                    }
                }
            }
        }
        if (inf.getFilter() == null) {
            log.info("Archive {} does not contain filter definition.", this);
        }
        if (inf.getConfig() == null) {
            log.info("Archive {} does not contain vault config.", this);
        }
        if (inf.getSettings() == null) {
            log.info("Archive {} does not contain vault settings. using default.", this);
            VaultSettings settings = new VaultSettings();
            settings.getIgnoredNames().add(".svn");
            inf.setSettings(settings);
        }
        if (inf.getProperties() == null) {
            log.info("Archive {} does not contain properties.", this);
        }
        if (inf.getNodeTypes().isEmpty()) {
            log.info("Archive {} does not contain nodetypes.", this);
        }
        return inf;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.vault.fs.config.DefaultMetaInf

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.