Package org.apache.jackrabbit.vault.fs.io

Examples of org.apache.jackrabbit.vault.fs.io.Importer


    public void testImport() throws IOException, RepositoryException, ConfigurationException {
        ZipArchive archive = new ZipArchive(getTempFile("testpackages/tmp.zip"));
        archive.open(true);
        Node rootNode = admin.getRootNode();
        ImportOptions opts = getDefaultOptions();
        Importer importer = new Importer(opts);
        importer.run(archive, rootNode);

        assertNodeExists("/tmp/foo/bar/tobi");
    }
View Full Code Here


        ZipArchive archive = new ZipArchive(getTempFile("testpackages/filtered_package.zip"));
        archive.open(true);
        Node rootNode = admin.getRootNode();
        ImportOptions opts = getDefaultOptions();

        Importer importer = new Importer(opts);
        importer.run(archive, rootNode);

        assertNodeExists("/tmp");
        assertNodeExists("/tmp/foo");
        assertNodeExists("/tmp/foo/bar");
        assertNodeExists("/tmp/foo/bar/tobi");
View Full Code Here

        ZipArchive archive = new ZipArchive(getTempFile("testpackages/unfiltered_package.zip"));
        archive.open(true);
        Node rootNode = admin.getRootNode();
        ImportOptions opts = getDefaultOptions();

        Importer importer = new Importer(opts);
        importer.run(archive, rootNode);

        assertNodeExists("/tmp");
        assertNodeExists("/tmp/foo");
        assertNodeExists("/tmp/foo/bar");
        assertNodeExists("/tmp/foo/bar/tobi");
View Full Code Here

        WorkspaceFilter filter = archive.getMetaInf().getFilter();
        for (PathFilterSet pathFilterSet : filter.getFilterSets()) {
            pathFilterSet.setRoot(TEST_ROOT + pathFilterSet.getRoot());
        }
        opts.setFilter(filter);
        Importer importer = new Importer(opts);
        importer.run(archive, rootNode);

        assertNodeExists(TEST_ROOT + "/tmp/foo/bar/tobi");
    }
View Full Code Here

        admin.save();

        archive.open(true);
        Node rootNode = admin.getNode(TEST_ROOT);
        ImportOptions opts = getDefaultOptions();
        Importer importer = new Importer(opts);
        importer.run(archive, rootNode);

        assertNodeExists(TEST_ROOT);
    }
View Full Code Here

        archive.open(true);
        Node rootNode = admin.getNode(TEST_ROOT);
        ImportOptions opts = getDefaultOptions();
        //opts.setListener(new DefaultProgressListener());
        Importer importer = new Importer(opts);
        importer.run(archive, rootNode);
        admin.save();

        assertNodeExists(TEST_ROOT + "/n3/n3/n3");
        assertNodeMissing(TEST_ROOT + "dummy");
    }
View Full Code Here

        ZipArchive archive = new ZipArchive(getTempFile("testpackages/tags.zip"));
        archive.open(true);
        Node rootNode = admin.getRootNode();
        ImportOptions opts = getDefaultOptions();
        opts.setAutoSaveThreshold(7);
        Importer importer = new Importer(opts);
        importer.setDebugFailAfterSave(2);
        importer.run(archive, rootNode);
        admin.save();

        // count nodes
        assertNodeExists("/etc/tags");
        Node tags = admin.getNode("/etc/tags");
View Full Code Here

    public void testSNSImport() throws IOException, RepositoryException, ConfigurationException {
        ZipArchive archive = new ZipArchive(getTempFile("testpackages/test_sns.zip"));
        archive.open(true);
        Node rootNode = admin.getRootNode();
        ImportOptions opts = getDefaultOptions();
        Importer importer = new Importer(opts);
        importer.run(archive, rootNode);

        assertNodeExists("/tmp/testroot");
        assertNodeExists("/tmp/testroot/foo");
        assertProperty("/tmp/testroot/foo/name", "foo1");
View Full Code Here

        Archive subArchive =  archive.getSubArchive("META-INF/vault/definition", true);

        DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
        filter.add(new PathFilterSet(defNode.getPath()));

        Importer importer = new Importer(opts);
        importer.getOptions().setAutoSaveThreshold(Integer.MAX_VALUE);
        importer.getOptions().setFilter(filter);
        importer.run(subArchive, defNode);
        admin.save();

        assertFalse("Importer must not have any errors", importer.hasErrors());
        assertNodeExists("/tmp/package.zip/jcr:content/vlt:definition/thumbnail.png");
    }
View Full Code Here

                log.error("Package extraction requires admin session.");
                throw new PackageException("Package extraction requires admin session (userid not allowed).");
            }
        }

        Importer importer = new Importer(opts);
        AccessControlHandling ac = getACHandling();
        if (opts.getAccessControlHandling() == null) {
            opts.setAccessControlHandling(ac);
        }
        String cndPattern = getProperty(NAME_CND_PATTERN);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.vault.fs.io.Importer

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.