Examples of closeArchiveEntry()


Examples of org.apache.commons.compress.archivers.ArchiveOutputStream.closeArchiveEntry()

        {
            warOutputStream = new FileOutputStream( tmpWar );
            os = new ArchiveStreamFactory().createArchiveOutputStream( ArchiveStreamFactory.JAR, warOutputStream );
            os.putArchiveEntry( new JarArchiveEntry( "META-INF/context.xml" ) );
            IOUtils.copy( new FileInputStream( contextXmlFile ), os );
            os.closeArchiveEntry();

            JarFile jarFile = new JarFile( warFile );
            Enumeration<JarEntry> jarEntries = jarFile.entries();
            while ( jarEntries.hasMoreElements() )
            {
View Full Code Here

Examples of org.apache.commons.compress.archivers.ArchiveOutputStream.closeArchiveEntry()

            while ( jarEntries.hasMoreElements() )
            {
                JarEntry jarEntry = jarEntries.nextElement();
                os.putArchiveEntry( new JarArchiveEntry( jarEntry.getName() ) );
                IOUtils.copy( jarFile.getInputStream( jarEntry ), os );
                os.closeArchiveEntry();
            }
            os.flush();
        }
        finally
        {
View Full Code Here

Examples of org.apache.commons.compress.archivers.ar.ArArchiveOutputStream.closeArchiveEntry()

            archive.deleteOnExit();
            aos = new ArArchiveOutputStream(new FileOutputStream(archive));
            long beforeArchiveWrite = tmp[0].lastModified();
            ArArchiveEntry in = new ArArchiveEntry(tmp[0], "foo");
            aos.putArchiveEntry(in);
            aos.closeArchiveEntry();
            aos.close();
            aos = null;
            ais = new ArArchiveInputStream(new FileInputStream(archive));
            ArArchiveEntry out = ais.getNextArEntry();
            ais.close();
View Full Code Here

Examples of org.apache.commons.compress.archivers.cpio.CpioArchiveOutputStream.closeArchiveEntry()

            archive.deleteOnExit();
            tos = new CpioArchiveOutputStream(new FileOutputStream(archive));
            long beforeArchiveWrite = tmp[0].lastModified();
            CpioArchiveEntry in = new CpioArchiveEntry(tmp[0], "foo");
            tos.putArchiveEntry(in);
            tos.closeArchiveEntry();
            tos.close();
            tos = null;
            tis = new CpioArchiveInputStream(new FileInputStream(archive));
            CpioArchiveEntry out = tis.getNextCPIOEntry();
            tis.close();
View Full Code Here

Examples of org.apache.commons.compress.archivers.jar.JarArchiveOutputStream.closeArchiveEntry()

        JarArchiveEntry jentry = new JarArchiveEntry(f.getName());
        FileInputStream fis = new FileInputStream(f);
        out.putArchiveEntry(jentry);
        IOUtils.copy(fis, out);
        fis.close();
        out.closeArchiveEntry();
      }
      out.finish();
    } catch (IOException e) {
      throw new CompileProcessorException("Exception while writing jar", e);
    } finally {
View Full Code Here

Examples of org.apache.commons.compress.archivers.sevenz.SevenZOutputFile.closeArchiveEntry()

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

Examples of org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry()

                outTarStream.putArchiveEntry(tarArchiveEntry);
                for(long i = 0; i < fileSize; i+= ba_1k.length) {
                    outTarStream.write(ba_1k);
                }
                outTarStream.closeArchiveEntry();
                outTarStream.close();
                outTarFileStream.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
View Full Code Here

Examples of org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry()

        ze.setModTime(0);
        long size = ph.data.size();
        ze.setSize(size);
        tarOS.putArchiveEntry(ze);
        BucketTools.copyTo(ph.data, tarOS, size);
        tarOS.closeArchiveEntry();
      }
    } finally {
      tarOS.close();
    }
   
View Full Code Here

Examples of org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry()

        new FileOutputStream(archiveFile));
    TarArchiveEntry entry = new TarArchiveEntry(p.getName());
    entry.setSize(bytes.length);
    out.putArchiveEntry(entry);
    out.write(bytes);
    out.closeArchiveEntry();
    out.close();

    LocalResource ret = recordFactory.newRecordInstance(LocalResource.class);
    ret.setResource(ConverterUtils.getYarnUrlFromPath(new Path(p.toString()
        + ".tar")));
View Full Code Here

Examples of org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry()

        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();

    LocalResource ret = recordFactory.newRecordInstance(LocalResource.class);
    ret.setResource(ConverterUtils.getYarnUrlFromPath(new Path(p.toString()
        + ".tar.gz")));
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.