Package org.apache.avalon.repository

Examples of org.apache.avalon.repository.RepositoryException


            return Defaults.getStaticProperties(
              DefaultRepositoryCriteria.class, DEFAULTS );
        }
        catch ( IOException e )
        {
            throw new RepositoryException(
             "Failed to load implementation defaults resource: "
             + DEFAULTS, e );
        }
    }
View Full Code Here


        }
        catch( Throwable e )
        {
            final String error =
              "Internal error while attempt to construct initial repository.";
            throw new RepositoryException( error, e );          
        }

        Attributes attributes = m_repository.getAttributes( artifact );
        FactoryDescriptor descriptor = new FactoryDescriptor( attributes );
        String classname = descriptor.getFactory();
        if( null == classname )
        {
            final String error =
              "Required property 'avalon.artifact.factory' not present in artifact: ["
              + artifact + "] under the active repository: [" + m_repository + "].";
            throw new IllegalArgumentException( error );
        }

        m_classloader = m_repository.getClassLoader( parent, artifact );
        Class clazz = loadFactoryClass( m_classloader, classname );

        try
        {
            m_delegate = createDelegate( m_classloader, classname, m_context );
        }
        catch( Throwable e )
        {
            final String error =
              "Unable to establish a factory for the supplied artifact:";
            StringBuffer buffer = new StringBuffer( error );
            buffer.append( "\n artifact: " + artifact );
            buffer.append( "\n build: " + descriptor.getBuild() );
            buffer.append( "\n factory: " + descriptor.getFactory() );
            buffer.append( "\n source: "
              + clazz.getProtectionDomain().getCodeSource().getLocation() );
            buffer.append( "\n repository: " + m_repository );
            throw new RepositoryException( buffer.toString(), e );
        }
    }
View Full Code Here

          + " from hosts: " );
        for( int i=0; i<repositories.length; i++ )
        {
            buffer.append( "\n  " + repositories[i] );
        }
        throw new RepositoryException( buffer.toString(), cause );
    }
View Full Code Here

          + " from hosts: " );
        for( int i=0; i<repositories.length; i++ )
        {
            buffer.append( "\n  " + repositories[i] );
        }
        throw new RepositoryException( buffer.toString(), cause );
    }
View Full Code Here

        catch( Throwable e )
        {
            final String error =
              "Internal error while attempting to create a url from the file: "
              + file;
            throw new RepositoryException( error, e );
        }
    }
View Full Code Here

        File local = new File( cache, artifact.getPath() + "." + META );
        if( !local.exists() )
        {
            final String error = "Cannot load metadata due to missing resurce.";
            Throwable cause = new FileNotFoundException( local.toString() );
            throw new RepositoryException( error, cause );
        }

        try
        {
            Properties properties = new Properties();
            InputStream input = new FileInputStream( local );
            properties.load( input );
            return properties;
        }
        catch( Throwable e )
        {
            final String error =
              "Unexpected error while attempting to load properties from local meta: "
              + local.toString();
            throw new RepositoryException( error, e );
        }
    }
View Full Code Here

        for ( int ii = 0; ii < repositories.length; ii++ )
        {
            l_repos.append( repositories[ii] ).append( ',' ) ;
        }

        throw new RepositoryException(
            "None of the repositories [" + l_repos.toString()
            + "] contained the metadata properties for "
            + artifact, l_throwable ) ;
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.repository.RepositoryException

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.