Package org.codehaus.plexus.archiver.zip

Examples of org.codehaus.plexus.archiver.zip.ZipOutputStream


        if ( !createEmpty )
        {
            return true;
        }

        ZipOutputStream zOut = null;
        try
        {
            getLogger().debug( "Building MANIFEST-only jar: "
                               + getDestFile().getAbsolutePath() );
            zOut = new ZipOutputStream( new FileOutputStream( getDestFile() ) );

            zOut.setEncoding( getEncoding() );
            if ( isCompress() )
            {
                zOut.setMethod( ZipOutputStream.DEFLATED );
            }
            else
            {
                zOut.setMethod( ZipOutputStream.STORED );
            }
            initZipOutputStream( zOut );
            finalizeZipOutputStream( zOut );
        }
        catch ( IOException ioe )
        {
            throw new ArchiverException( "Could not create almost empty JAR archive"
                                         + " (" + ioe.getMessage() + ")", ioe );
        }
        finally
        {
            // Close the output stream.
            try
            {
                if ( zOut != null )
                {
                    zOut.close();
                }
            }
            catch ( IOException ex )
            {
            }
View Full Code Here


        if ( !createEmpty )
        {
            return true;
        }

        ZipOutputStream zOut = null;
        try
        {
            getLogger().debug( "Building MANIFEST-only jar: " + getDestFile().getAbsolutePath() );
            zOut = new ZipOutputStream( new FileOutputStream( getDestFile() ) );

            zOut.setEncoding( getEncoding() );
            if ( isCompress() )
            {
                zOut.setMethod( ZipOutputStream.DEFLATED );
            }
            else
            {
                zOut.setMethod( ZipOutputStream.STORED );
            }
            initZipOutputStream( zOut );
            finalizeZipOutputStream( zOut );
        }
        catch ( IOException ioe )
View Full Code Here

     * @return A byte array containing the ZIP file.
     * @throws java.io.IOException If there was an error reading the contents of the source directory.
     */
    private byte[] createZipFile() throws IOException {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        final ZipOutputStream out = new ZipOutputStream(buffer);
        try {
            out.setMethod(ZipOutputStream.DEFLATED);
            out.setLevel(Deflater.BEST_COMPRESSION);
            ResourceIterator resourceIterator = getResources();
            addResources(resourceIterator, out);
        } finally {
            out.close();
        }
        return buffer.toByteArray();
    }
View Full Code Here

        if ( !createEmpty )
        {
            return true;
        }

        ZipOutputStream zOut = null;
        try
        {
            getLogger().debug( "Building MANIFEST-only jar: "
                               + getDestFile().getAbsolutePath() );
            zOut = new ZipOutputStream( new FileOutputStream( getDestFile() ) );

            zOut.setEncoding( getEncoding() );
            if ( isCompress() )
            {
                zOut.setMethod( ZipOutputStream.DEFLATED );
            }
            else
            {
                zOut.setMethod( ZipOutputStream.STORED );
            }
            initZipOutputStream( zOut );
            finalizeZipOutputStream( zOut );
        }
        catch ( IOException ioe )
        {
            throw new ArchiverException( "Could not create almost empty JAR archive"
                                         + " (" + ioe.getMessage() + ")", ioe );
        }
        finally
        {
            // Close the output stream.
            try
            {
                if ( zOut != null )
                {
                    zOut.close();
                }
            }
            catch ( IOException ex )
            {
            }
View Full Code Here

     * @return A byte array containing the ZIP file.
     * @throws java.io.IOException If there was an error reading the contents of the source directory.
     */
    private byte[] createZipFile() throws IOException {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        final ZipOutputStream out = new ZipOutputStream(buffer);
        try {
            out.setMethod(ZipOutputStream.DEFLATED);
            out.setLevel(Deflater.BEST_COMPRESSION);
            ResourceIterator resourceIterator = getResources();
            addResources(resourceIterator, out);
        } finally {
            out.close();
        }
        return buffer.toByteArray();
    }
View Full Code Here

     * @return A byte array containing the ZIP file.
     * @throws java.io.IOException If there was an error reading the contents of the source directory.
     */
    private byte[] createZipFile() throws IOException {
        final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
        final ZipOutputStream out = new ZipOutputStream(buffer);
        try {
            out.setMethod(ZipOutputStream.DEFLATED);
            out.setLevel(Deflater.BEST_COMPRESSION);
            ResourceIterator resourceIterator = getResources();
            addResources(resourceIterator, out);
        } finally {
            out.close();
        }
        return buffer.toByteArray();
    }
View Full Code Here

        if ( !createEmpty )
        {
            return true;
        }

        ZipOutputStream zOut = null;
        try
        {
            getLogger().debug( "Building MANIFEST-only jar: "
                               + getDestFile().getAbsolutePath() );
            zOut = new ZipOutputStream( new FileOutputStream( getDestFile() ) );

            zOut.setEncoding( getEncoding() );
            if ( isCompress() )
            {
                zOut.setMethod( ZipOutputStream.DEFLATED );
            }
            else
            {
                zOut.setMethod( ZipOutputStream.STORED );
            }
            initZipOutputStream( zOut );
            finalizeZipOutputStream( zOut );
        }
        catch ( IOException ioe )
        {
            throw new ArchiverException( "Could not create almost empty JAR archive"
                                         + " (" + ioe.getMessage() + ")", ioe );
        }
        finally
        {
            // Close the output stream.
            try
            {
                if ( zOut != null )
                {
                    zOut.close();
                }
            }
            catch ( IOException ex )
            {
            }
View Full Code Here

        if ( !createEmpty )
        {
            return true;
        }

        ZipOutputStream zOut = null;
        try
        {
            getLogger().debug( "Building MANIFEST-only jar: "
                               + getDestFile().getAbsolutePath() );
            zOut = new ZipOutputStream( new FileOutputStream( getDestFile() ) );

            zOut.setEncoding( getEncoding() );
            if ( isCompress() )
            {
                zOut.setMethod( ZipOutputStream.DEFLATED );
            }
            else
            {
                zOut.setMethod( ZipOutputStream.STORED );
            }
            initZipOutputStream( zOut );
            finalizeZipOutputStream( zOut );
        }
        catch ( IOException ioe )
        {
            throw new ArchiverException( "Could not create almost empty JAR archive"
                                         + " (" + ioe.getMessage() + ")", ioe );
        }
        finally
        {
            // Close the output stream.
            try
            {
                if ( zOut != null )
                {
                    zOut.close();
                }
            }
            catch ( IOException ex )
            {
            }
View Full Code Here

        if ( !createEmpty )
        {
            return true;
        }

        ZipOutputStream zOut = null;
        try
        {
            getLogger().debug( "Building MANIFEST-only jar: "
                               + getDestFile().getAbsolutePath() );
            zOut = new ZipOutputStream( new FileOutputStream( getDestFile() ) );

            zOut.setEncoding( getEncoding() );
            if ( isCompress() )
            {
                zOut.setMethod( ZipOutputStream.DEFLATED );
            }
            else
            {
                zOut.setMethod( ZipOutputStream.STORED );
            }
            initZipOutputStream( zOut );
            finalizeZipOutputStream( zOut );
        }
        catch ( IOException ioe )
        {
            throw new ArchiverException( "Could not create almost empty JAR archive"
                                         + " (" + ioe.getMessage() + ")", ioe );
        }
        finally
        {
            // Close the output stream.
            try
            {
                if ( zOut != null )
                {
                    zOut.close();
                }
            }
            catch ( IOException ex )
            {
            }
View Full Code Here

        if ( !createEmpty )
        {
            return true;
        }

        ZipOutputStream zOut = null;
        try
        {
            getLogger().debug( "Building MANIFEST-only jar: " + getDestFile().getAbsolutePath() );
            FileOutputStream out = new FileOutputStream( getDestFile() );
            zOut = new ZipOutputStream( new BufferedOutputStream( out, 65536) );

            zOut.setEncoding( getEncoding() );
            if ( isCompress() )
            {
                zOut.setMethod( ZipOutputStream.DEFLATED );
            }
            else
            {
                zOut.setMethod( ZipOutputStream.STORED );
            }
            initZipOutputStream( zOut );
            finalizeZipOutputStream( zOut );
        }
        catch ( IOException ioe )
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.archiver.zip.ZipOutputStream

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.