Package org.apache.commons.compress.archivers.sevenz

Examples of org.apache.commons.compress.archivers.sevenz.SevenZOutputFile


    private void testSevenZArchiveCreation(SevenZMethod method) throws Exception {
        final File output = new File(dir, "bla.7z");
        final File file1 = getFile("test1.xml");
        final File file2 = getFile("test2.xml");

        final SevenZOutputFile outArchive = new SevenZOutputFile(output);
        outArchive.setContentCompression(method);
        try {
            SevenZArchiveEntry entry;
           
            entry = outArchive.createArchiveEntry(file1, file1.getName());
            outArchive.putArchiveEntry(entry);
            copy(file1, outArchive);
            outArchive.closeArchiveEntry();
           
            entry = outArchive.createArchiveEntry(file2, file2.getName());
            outArchive.putArchiveEntry(entry);
            copy(file2, outArchive);
            outArchive.closeArchiveEntry();
        } finally {
            outArchive.close();
        }
       
        final SevenZFile archive = new SevenZFile(output);
        try {
            SevenZArchiveEntry entry;
View Full Code Here


        super(ArchiveFormat.SEVEN_Z);
    }

    @Override
    protected ArchiveOutputStream createArchiveOutputStream(File archive) throws IOException {
        return new SevenZOutputStream(new SevenZOutputFile(archive));
    }
View Full Code Here

    public static class SevenZArchiveOutputStream extends ArchiveOutputStream {

        private final SevenZOutputFile zipFile;

        public SevenZArchiveOutputStream(File file) throws IOException {
            zipFile = new SevenZOutputFile(file);
        }
View Full Code Here

TOP

Related Classes of org.apache.commons.compress.archivers.sevenz.SevenZOutputFile

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.