Examples of TarCompressionMethod


Examples of org.codehaus.plexus.archiver.tar.TarArchiver.TarCompressionMethod

        }

        File archive = new File(f, archiveName);

        try {
            TarCompressionMethod method = new TarCompressionMethod();

            method.setValue("bzip2");

            archiver.setCompression(method);
            archiver.setForced(forceCreation);
            archiver.setDestFile(archive);
            archiver.addDirectory(directory);
View Full Code Here

Examples of org.codehaus.plexus.archiver.tar.TarArchiver.TarCompressionMethod

                public void debug(final String message,
                        final Throwable throwable) {
                }
            });
            final TarCompressionMethod compression = new TarCompressionMethod();
            File dataTarGz = null;
            if (!gem.getGemFiles().isEmpty()) {
                // tar.gz the content into data.tar.gz
                dataTarGz = new File(gemWorkdir, "data.tar.gz");
                compression.setValue("gzip");
                tar.setCompression(compression);
                tar.setDestFile(dataTarGz);
                for (final GemFileEntry entry : gem.getGemFiles()) {
                    if (entry.getSource().isFile()) {
                        tar.addFile(entry.getSource(), entry.getPathInGem());
                    }
                    else if (entry.getSource().isDirectory()) {
                        tar.addDirectory(entry.getSource(),
                                         entry.getPathInGem());
                    }
                }
                tar.createArchive();
            }

            // and finally create gem by tar.gz-ing data.tar.gz and metadata.gz
            final File gemFile = new File(target, gem.getGemFilename());
            tar.setDestFile(gemFile);
            compression.setValue("none");
            tar.setCompression(compression);
            if (dataTarGz != null) {
                tar.addFile(dataTarGz, dataTarGz.getName());
            }
            tar.addFile(metadataGz, metadataGz.getName());
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.