Examples of TarArchiveEntry


Examples of org.apache.commons.compress.archivers.tar.TarArchiveEntry

        final File packageDir = temporaryFolder.newFolder();
        ArchiveUtils.extractAr(debFile, packageDir);

        try (final TarArchiveInputStream in = new TarArchiveInputStream(new GZIPInputStream(new FileInputStream(new File(packageDir, "data.tar.gz"))))) {
            final TarArchiveEntry entry = in.getNextTarEntry();
            assertEquals("./test.txt", entry.getName());
            assertEquals(USER, entry.getUserName());
            assertEquals(USER, entry.getGroupName());
            assertEquals(0764, entry.getMode());
        }
    }
View Full Code Here

Examples of org.apache.commons.compress.archivers.tar.TarArchiveEntry

    File archiveFile = new File(p.toUri().getPath() + ".tar");
    archiveFile.createNewFile();
    TarArchiveOutputStream out = new TarArchiveOutputStream(
        new FileOutputStream(archiveFile));
    TarArchiveEntry entry = new TarArchiveEntry(p.getName());
    entry.setSize(bytes.length);
    out.putArchiveEntry(entry);
    out.write(bytes);
    out.closeArchiveEntry();
    out.close();
View Full Code Here

Examples of org.apache.commons.compress.archivers.tar.TarArchiveEntry

    File gzipFile = new File(p.toUri().getPath() + ".tar.gz");
    gzipFile.createNewFile();
    TarArchiveOutputStream out = new TarArchiveOutputStream(
        new GZIPOutputStream(new FileOutputStream(gzipFile)));
    TarArchiveEntry entry = new TarArchiveEntry(p.getName());
    entry.setSize(bytes.length);
    out.putArchiveEntry(entry);
    out.write(bytes);
    out.closeArchiveEntry();
    out.close();
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.