Package org.codehaus.plexus.archiver

Examples of org.codehaus.plexus.archiver.ArchiverException


        {
            config = Xpp3DomBuilder.build( new StringReader( configSource.getArchiverConfig() ) );
        }
        catch ( final XmlPullParserException e )
        {
            throw new ArchiverException(
                                         "Failed to parse archiver configuration for: " + archiver.getClass().getName(),
                                         e );
        }
        catch ( final IOException e )
        {
            throw new ArchiverException(
                                         "Failed to parse archiver configuration for: " + archiver.getClass().getName(),
                                         e );
        }

        getLogger().debug( "Configuring archiver: '" + archiver.getClass().getName() + "' -->" );

        try
        {
            configureComponent( archiver, config, configSource );
        }
        catch ( final ComponentConfigurationException e )
        {
            throw new ArchiverException( "Failed to configure archiver: " + archiver.getClass().getName(), e );
        }
        catch ( final ComponentLookupException e )
        {
            throw new ArchiverException( "Failed to lookup configurator for setup of archiver: "
                + archiver.getClass().getName(), e );
        }

        getLogger().debug( "-- end configuration --" );
    }
View Full Code Here


                        manifestFileReader = new InputStreamReader( new FileInputStream( manifestFile ), "UTF-8" );
                        manifest = new Manifest( manifestFileReader );
                    }
                    catch ( final FileNotFoundException e )
                    {
                        throw new ArchiverException( "Manifest not found: " + e.getMessage(), e );
                    }
                    catch ( final IOException e )
                    {
                        throw new ArchiverException( "Error processing manifest: " + e.getMessage(), e );
                    }
                    finally
                    {
                        IOUtil.close( manifestFileReader );
                    }
                }
                else
                {
                    manifest = mavenArchiver.getManifest( session, project, archiveConfiguration );
                }

                if ( ( manifest != null ) && ( archiver instanceof JarArchiver ) )
                {
                    final JarArchiver jarArchiver = (JarArchiver) archiver;
                    jarArchiver.addConfiguredManifest( manifest );
                }
            }
            catch ( final ManifestException e )
            {
                throw new ArchiverException( "Error creating manifest: " + e.getMessage(), e );
            }
            catch ( final DependencyResolutionRequiredException e )
            {
                throw new ArchiverException( "Dependencies were not resolved: " + e.getMessage(), e );
            }
        }
    }
View Full Code Here

            // Write the CRX file

            final CRXArchive archive = new CRXArchive(publicKey, signature, zipData);
            archiveHelper.writeArchive(getDestFile(), archive);
        } catch (final GeneralSecurityException e) {
            throw new ArchiverException("Could not generate the signature for the CRX file", e);
        } catch (final IOException e) {
            throw new ArchiverException("Could not read resources or output the CRX file", e);
        }
    }
View Full Code Here

                        final RSAPublicKeySpec publicKeySpec = new RSAPublicKeySpec(modulus, exponent);
                        final KeyFactory keyFactory = KeyFactory.getInstance("RSA", "BC");
                        final PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);
                        return new KeyPair(publicKey, privateCrtKey);
                    } else {
                        throw new ArchiverException("Could not load the public/private key from invalid PEM file");
                    }
                } finally {
                    pemReader.close();
                }
            } finally {
                pemFileReader.close();
            }
        } catch (final InvalidKeySpecException e) {
            throw new ArchiverException("Cannot generate RSA public key", e);
        } catch (final NoSuchAlgorithmException e) {
            throw new ArchiverException("RSA Private key algorithm is not supported", e);
        } catch (final NoSuchProviderException e) {
            throw new ArchiverException("Bouncy Castle not registered correctly", e);
        } catch (final IOException e) {
            throw new ArchiverException("Could not load the public/private key from the PEM file", e);
        }
    }
View Full Code Here

        ArchiverManagerStub.archiverStub = new JarArchiverStub()
        {
            public void addDirectory( File file, String string, String[] includes, String[] excludes )
                throws ArchiverException
            {
                throw new ArchiverException( "Intentional exception" );
            }
        };

        try
        {
View Full Code Here

        ArchiverManagerStub.archiverStub = new JarArchiverStub()
        {
            public void addDirectory( File file, String string, String[] includes, String[] excludes )
                throws ArchiverException
            {
                throw new ArchiverException( "Intentional exception" );
            }
        };

        try
        {
View Full Code Here

                            return false;
                        }
                    }
                    catch ( final IOException e )
                    {
                        throw new ArchiverException( "Error processing file: " + inputFile + " using selector: "
                                        + selectors[i], e );
                    }
                }
            }
        }
View Full Code Here

    unarchiver.setDestDirectory(target);
    unarchiver.setOverwrite(true);
    try {
      unarchiver.extract();
    } catch (Exception e) {
      throw new ArchiverException("Failed to extract WebJar artifact to " + target, e);
    }
  }
View Full Code Here

    try {
      // we don't want Maven stuff
      archive.setAddMavenDescriptor( false );
      archiver.createArchive( project, archive );
    } catch ( ManifestException e ) {
      throw new ArchiverException( "ManifestException: " + e.getMessage(), e );
    } catch ( DependencyResolutionRequiredException e ) {
      throw new ArchiverException( "DependencyResolutionRequiredException: " + e.getMessage(), e );
    }
    return javadocJar;
  }
View Full Code Here

        {
            String defManifest = "/org/codehaus/plexus/archiver/jar/defaultManifest.mf";
            InputStream in = Manifest.class.getResourceAsStream( defManifest );
            if ( in == null )
            {
                throw new ArchiverException( "Could not find default manifest: "
                                             + defManifest );
            }
            try
            {
                Manifest defaultManifest
                    = new Manifest( new InputStreamReader( in, "UTF-8" ) );
                Attribute createdBy = new Attribute( "Created-By",
                                                     System.getProperty( "java.vm.version" ) + " ("
                                                     + System.getProperty( "java.vm.vendor" ) + ")" );
                defaultManifest.getMainSection().storeAttribute( createdBy );
                return defaultManifest;
            }
            catch ( UnsupportedEncodingException e )
            {
                return new Manifest( new InputStreamReader( in ) );
            }
        }
        catch ( ManifestException e )
        {
            throw new ArchiverException( "Default manifest is invalid !!", e );
        }
        catch ( IOException e )
        {
            throw new ArchiverException( "Unable to read default manifest", e );
        }
    }
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.