Examples of GzipCompressorInputStream


Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

                    "Compressor name and stream must not be null.");
        }

        try {
            if ("gz".equalsIgnoreCase(name)) {
                return new GzipCompressorInputStream(in);
            } else if ("bzip2".equalsIgnoreCase(name)) {
                return new BZip2CompressorInputStream(in);
            }
        } catch (IOException e) {
            throw new CompressorException(
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

    }

    private void extractGzArchive(InputStream tarGz, File tar) throws IOException {
        BufferedInputStream in = new BufferedInputStream(tarGz);
        FileOutputStream out = new FileOutputStream(tar);
        GzipCompressorInputStream gzIn = new GzipCompressorInputStream(in);
        final byte[] buffer = new byte[1000];
        int n = 0;
        while (-1 != (n = gzIn.read(buffer))) {
            out.write(buffer, 0, n);
        }
        out.close();
        gzIn.close();
    }
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

        extract(new ZipArchiveInputStream(is), targetDir);
    }

    protected static void extractUnixKit(File targetDir) throws Exception {
        InputStream is = Helper.class.getResourceAsStream("/karaf.tar.gz");
        extract(new TarArchiveInputStream(new GzipCompressorInputStream(is)), targetDir);
        File bin = new File(targetDir, "bin");
        String[] files = bin.list();
        List<String> args = new ArrayList();
        Collections.addAll(args, "chmod", "+x");
        Collections.addAll(args, files);
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

            if (BZip2CompressorInputStream.matches(signature, signatureLength)) {
                return new BZip2CompressorInputStream(in, decompressConcatenated);
            }

            if (GzipCompressorInputStream.matches(signature, signatureLength)) {
                return new GzipCompressorInputStream(in, decompressConcatenated);
            }

            if (XZUtils.isXZCompressionAvailable() &&
                XZCompressorInputStream.matches(signature, signatureLength)) {
                return new XZCompressorInputStream(in, decompressConcatenated);
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

        }

        try {

            if (GZIP.equalsIgnoreCase(name)) {
                return new GzipCompressorInputStream(in);
            }

            if (BZIP2.equalsIgnoreCase(name)) {
                return new BZip2CompressorInputStream(in);
            }
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

            if (BZip2CompressorInputStream.matches(signature, signatureLength)) {
                return new BZip2CompressorInputStream(in);
            }

            if (GzipCompressorInputStream.matches(signature, signatureLength)) {
                return new GzipCompressorInputStream(in);
            }

            if (Pack200CompressorInputStream.matches(signature, signatureLength)) {
                return new Pack200CompressorInputStream(in);
            }
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

        }

        try {

            if (GZIP.equalsIgnoreCase(name)) {
                return new GzipCompressorInputStream(in);
            }

            if (BZIP2.equalsIgnoreCase(name)) {
                return new BZip2CompressorInputStream(in);
            }
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

    }

    private void extractGzArchive(InputStream tarGz, File tar) throws IOException {
        BufferedInputStream in = new BufferedInputStream(tarGz);
        FileOutputStream out = new FileOutputStream(tar);
        GzipCompressorInputStream gzIn = new GzipCompressorInputStream(in);
        final byte[] buffer = new byte[1000];
        int n = 0;
        while (-1 != (n = gzIn.read(buffer))) {
            out.write(buffer, 0, n);
        }
        out.close();
        gzIn.close();
    }
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

            if ("control.tar.gz".equals(readableArFile.getName())) {

                ArchiveInputStream input = null;
                try {
                    input = new ArchiveStreamFactory()
                            .createArchiveInputStream(new BufferedInputStream(new GzipCompressorInputStream(readableArFile.open())));
                } catch (ArchiveException e) {
                    throw new IOException(e);
                }
                ArchiveEntry ae;
                while ((ae = input.getNextEntry()) != null) {
View Full Code Here

Examples of org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream

            ArchiveInputStream input;

            /* I am really sad that classes aren't first-class objects in
               Java :'( */
            try {
                input = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(file)));
            } catch (IOException e) {
                try {
                    input = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(file)));
                } catch (IOException e2) {
                    input = new ZipArchiveInputStream(new FileInputStream(file));
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.