Examples of ZipArchive


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

    }

    @Test
    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);
View Full Code Here

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

    }


    @Test
    public void testSubArchiveExtract() throws IOException, RepositoryException, ConfigurationException {
        ZipArchive archive = new ZipArchive(getTempFile("testpackages/tmp_with_thumbnail.zip"));
        archive.open(true);
        Node rootNode = admin.getRootNode();
        Node tmpNode = rootNode.addNode("tmp");
        Node fileNode = tmpNode.addNode("package.zip", "nt:file");
        Node contentNode = fileNode.addNode("jcr:content", "nt:resource");
        contentNode.setProperty("jcr:data", "");
        contentNode.setProperty("jcr:lastModified", 0);
        contentNode.addMixin("vlt:Package");
        Node defNode = contentNode.addNode("vlt:definition", "vlt:PackageDefinition");

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

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

        Importer importer = new Importer(opts);
View Full Code Here

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

        this(file, isTmpFile, false);
    }

    protected ZipVaultPackage(File file, boolean isTmpFile, boolean strict)
            throws IOException {
        this(new ZipArchive(file, isTmpFile), strict);
    }
View Full Code Here

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

        VaultFile vaultFile = vCtx.getFileSystem(addr).getFile(jcrPath);

        VaultFsApp.log.info("Importing {} to {}", localFile.getCanonicalPath(), vaultFile.getPath());
        Archive archive;
        if (localFile.isFile()) {
            archive = new ZipArchive(localFile);
        } else {
            if (cl.hasOption(optSync)) {
                VaultFsApp.log.warn("--sync is not supported yet");
            }
            archive = new FileArchive(localFile);
View Full Code Here

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

        File localFile = ctx.getVaultFsApp().getPlatformFile(localPath, false);
        VaultFile vaultFile = ctx.getVaultFsApp().getVaultFile(jcrPath, true);
        VaultFsApp.log.info("Importing {} to {}", localFile.getCanonicalPath(), vaultFile.getPath());
        Archive archive;
        if (localFile.isFile()) {
            archive = new ZipArchive(localFile);
        } else {
            archive = new FileArchive(localFile);
        }
        Importer importer = new Importer();
        if (verbose) {
View Full Code Here

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

            throws IOException {
        this.file = file;
        this.isTmpFile = isTmpFile;
        if (strict) {
            try {
                archive = new ZipArchive(file);
                archive.open(strict);
            } catch (IOException e) {
                log.error("Error while loading package {}.", file.getPath());
                throw e;
            }
View Full Code Here

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

        if (archive == null) {
            if (file == null) {
                log.error("Package already closed: " + id);
                throw new IllegalStateException("Package already closed: " + id);
            }
            archive = new ZipArchive(file);
            try {
                archive.open(false);
            } catch (IOException e) {
                log.error("Archive not valid.", e);
                throw new IllegalStateException("Archive not valid for file " + file, e);
View Full Code Here

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

        clean(ARCHIVE_ROOT);
    }

    @Test
    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);
View Full Code Here

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

        assertNodeExists("/tmp/foo/bar/tobi");
    }

    @Test
    public void testFilteredImport() throws IOException, RepositoryException, ConfigurationException {
        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);
View Full Code Here

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

        assertNodeMissing("/tmp/foo/bar/tom");
    }

    @Test
    public void testUnFilteredImport() throws IOException, RepositoryException, ConfigurationException {
        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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.