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

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


            session = getSession(resourceResolver);

            final String[] paths = request.getPaths();

            DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
            DefaultMetaInf inf = new DefaultMetaInf();
            ExportOptions opts = new ExportOptions();
            for (String path : paths) {
                filter.add(new PathFilterSet(path));
            }
            inf.setFilter(filter);

            Properties props = new Properties();
            String packageGroup = "sling/replication";
            props.setProperty(VaultPackage.NAME_GROUP, packageGroup);
            String packageName = String.valueOf(request.getTime());
            props.setProperty(VaultPackage.NAME_NAME, packageName);
            props.setProperty(VaultPackage.NAME_VERSION, VERSION);
            inf.setProperties(props);

            log.debug("assembling package {}", packageGroup + '/' + packageName + "-" + VERSION);

            opts.setMetaInf(inf);
            opts.setRootPath("/");
View Full Code Here


            if (vaultFile == null) {
                throw new VltException(remoteDir, "Error during checkout. Remote directory does not exit.");
            }
            // store filter and config
            if (!force) {
                DefaultMetaInf inf = (DefaultMetaInf) ctx.getMetaInf();
                inf.setConfig(vaultFile.getFileSystem().getConfig());
                inf.setFilter(vaultFile.getFileSystem().getWorkspaceFilter());
                inf.save(ctx.getExportRoot().getMetaDir());
            }
            if (ctx.isVerbose()) {
                DumpContext dc = new DumpContext(new PrintWriter(ctx.getStdout()));
                dc.println("Filter");
                ctx.getMetaInf().getFilter().dump(dc, true);
View Full Code Here

        assertNotNull(pack);
        pack.extract(getDefaultOptions());
        assertNodeExists("/tmp/foo/bar/test.txt");

        ExportOptions opts = new ExportOptions();
        DefaultMetaInf inf = new DefaultMetaInf();
        DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
        filter.add(new PathFilterSet("/tmp/foo/bar"));
        inf.setFilter(filter);
        Properties props = new Properties();
        props.setProperty(VaultPackage.NAME_GROUP, "adobe/test");
        props.setProperty(VaultPackage.NAME_NAME, "test-package");
        inf.setProperties(props);

        opts.setMetaInf(inf);
        opts.setMountPath("/tmp/foo");
        opts.setRootPath("/content/geometrixx");
        File tmpFile = File.createTempFile("vaulttest", "zip");
View Full Code Here

        content.setProperty("double_pos_inf", Double.POSITIVE_INFINITY);
        content.setProperty("double_neg_inf", Double.NEGATIVE_INFINITY);
        admin.save();

        ExportOptions opts = new ExportOptions();
        DefaultMetaInf inf = new DefaultMetaInf();
        DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
        PathFilterSet set1 = new PathFilterSet("/tmp");
        filter.add(set1);
        inf.setFilter(filter);
        Properties props = new Properties();
        props.setProperty(VaultPackage.NAME_GROUP, "adobe/test");
        props.setProperty(VaultPackage.NAME_NAME, "test-package");
        inf.setProperties(props);

        opts.setMetaInf(inf);
        File tmpFile = File.createTempFile("vaulttest", ".zip");
        VaultPackage pkg = packMgr.assemble(admin, opts, tmpFile);
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

    private boolean cacheMetaOnly = false;

    public MemoryArchive(boolean metaOnly) throws IOException {
        this.cacheMetaOnly = metaOnly;
        root = new VirtualEntry(null, "", 0, null);
        inf = new DefaultMetaInf();
    }
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

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

        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }
        MetaInf metaInf = opts.getMetaInf();
        if (metaInf == null) {
            metaInf = new DefaultMetaInf();
        }
        VaultFileSystem jcrfs = Mounter.mount(metaInf.getConfig(), metaInf.getFilter(), addr, opts.getRootPath(), s);
        JarExporter exporter = new JarExporter(out);
        exporter.setProperties(metaInf.getProperties());
        if (opts.getListener() != null) {
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.