Package org.codehaus.plexus.archiver

Examples of org.codehaus.plexus.archiver.ArchiverException


    private void validate()
        throws ArchiverException
    {
        if ( destFile == null )
        {
            throw new ArchiverException( "Destination file attribute is required" );
        }

        if ( destFile.isDirectory() )
        {
            throw new ArchiverException( "Destination file attribute must not "
                                         + "represent a directory!" );
        }

        if ( sourceFile == null )
        {
            throw new ArchiverException( "Source file attribute is required" );
        }

        if ( sourceFile.isDirectory() )
        {
            throw new ArchiverException( "Source file attribute must not "
                                         + "represent a directory!" );
        }
    }
View Full Code Here


            getLogger().debug( "expand complete" );

        }
        catch ( IOException ioe )
        {
            throw new ArchiverException( "Error while expanding " + getSourceFile().getAbsolutePath(), ioe );
        }
        finally
        {
            if ( tis != null )
            {
View Full Code Here

        throws ArchiverException
    {
        int index = indexOfValue( value );
        if ( index == -1 )
        {
            throw new ArchiverException( value + " is not a legal value for this attribute" );
        }
        this.index = index;
        this.value = value;
    }
View Full Code Here

                    final char[] magic = new char[]{'B', 'Z'};
                    for ( int i = 0; i < magic.length; i++ )
                    {
                        if ( istream.read() != magic[ i ] )
                        {
                            throw new ArchiverException( "Invalid bz2 file." + file.toString() );
                        }
                    }
                    return new CBZip2InputStream( istream );
                }
            }
View Full Code Here

        throws ArchiverException
    {
        deploymentDescriptor = descr;
        if ( !deploymentDescriptor.exists() )
        {
            throw new ArchiverException( "Deployment descriptor: "
                                         + deploymentDescriptor
                                         + " does not exist." );
        }

        addFile( descr, "WEB-INF/web.xml" );
View Full Code Here

        throws IOException, ArchiverException
    {
        // If no webxml file is specified, it's an error.
        if ( ignoreWebxml && deploymentDescriptor == null && !isInUpdateMode() )
        {
            throw new ArchiverException( "webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)" );
        }
        super.initZipOutputStream( zOut );
    }
View Full Code Here

      ResourceIterator iter = getResources();
      ArchiveEntry entry = iter.next();
      if ( iter.hasNext() )
      {
            throw new ArchiverException( "There is more than one file in input." );
        }
        compressor.setSource( entry.getResource() );
        compressor.setDestFile( getDestFile() );
        compressor.compress();
    }
View Full Code Here

                fis = new FileInputStream( getSourceFile() );
                bis = new BufferedInputStream( fis );
                zIn = getBZip2InputStream( bis );
                if ( zIn == null )
                {
                    throw new ArchiverException( getSourceFile().getAbsolutePath() + " is an invalid bz2 file." );
                }
                byte[] buffer = new byte[8 * 1024];
                int count = 0;
                do
                {
                    out.write( buffer, 0, count );
                    count = zIn.read( buffer, 0, buffer.length );
                }
                while ( count != -1 );
            }
            catch ( IOException ioe )
            {
                String msg = "Problem expanding bzip2 " + ioe.getMessage();
                throw new ArchiverException( msg, ioe );
            }
            finally
            {
                if ( bis != null )
                {
View Full Code Here

                logger.warn( "Standard output:" );
                logger.warn( "-------------------------------" );
                logger.warn( stdout.getOutput() );
                logger.warn( "-------------------------------" );

                throw new ArchiverException( "chmod exit code was: " + exitCode );
            }
        }
        catch ( CommandLineException e )
        {
            throw new ArchiverException( "Error while executing chmod.", e );
        }
    }
View Full Code Here

    private void validate()
        throws ArchiverException
    {
        if ( destFile == null )
        {
            throw new ArchiverException( "Destination file attribute is required" );
        }

        if ( destFile.isDirectory() )
        {
            throw new ArchiverException( "Destination file attribute must not "
                                         + "represent a directory!" );
        }

        if ( source == null )
        {
            throw new ArchiverException( "Source file attribute is required" );
        }

        if ( source.isDirectory() )
        {
            throw new ArchiverException( "Source file attribute must not "
                                         + "represent a directory!" );
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.archiver.ArchiverException

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.