Package org.apache.archiva.admin.model

Examples of org.apache.archiva.admin.model.RepositoryAdminException


        {
            CronExpressionValidator validator = new CronExpressionValidator();

            if ( !validator.validate( cronExpression ) )
            {
                throw new RepositoryAdminException( "Invalid cron expression.", "cronExpression" );
            }
        }
        else
        {
            throw new RepositoryAdminException( "Cron expression cannot be empty." );
        }

        String repoLocation = removeExpressions( managedRepository.getLocation() );

        if ( !GenericValidator.matchRegexp( repoLocation,
                                            ManagedRepositoryAdmin.REPOSITORY_LOCATION_VALID_EXPRESSION ) )
        {
            throw new RepositoryAdminException(
                "Invalid repository location. Directory must only contain alphanumeric characters, equals(=), question-marks(?), "
                    + "exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-).",
                "location" );
        }
    }
View Full Code Here


        {
            getArchivaConfiguration().save( config );
        }
        catch ( org.apache.archiva.redback.components.registry.RegistryException e )
        {
            throw new RepositoryAdminException( "Error occurred in the registry: " + e.getLocalizedMessage(), e );
        }
        catch ( IndeterminateConfigurationException e )
        {
            throw new RepositoryAdminException(
                "Error occurred while saving the configuration: " + e.getLocalizedMessage(), e );
        }
    }
View Full Code Here

    public Boolean addProxyConnector( ProxyConnector proxyConnector, AuditInformation auditInformation )
        throws RepositoryAdminException
    {
        if ( getProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId() ) != null )
        {
            throw new RepositoryAdminException(
                "Unable to add proxy connector, as one already exists with source repository id ["
                    + proxyConnector.getSourceRepoId() + "] and target repository id ["
                    + proxyConnector.getTargetRepoId() + "]." );
        }
View Full Code Here

        Configuration configuration = getArchivaConfiguration().getConfiguration();
        ProxyConnectorConfiguration proxyConnectorConfiguration =
            findProxyConnector( proxyConnector.getSourceRepoId(), proxyConnector.getTargetRepoId(), configuration );
        if ( proxyConnectorConfiguration == null )
        {
            throw new RepositoryAdminException(
                "unable to find ProxyConnector with source " + proxyConnector.getSourceRepoId() + " and target "
                    + proxyConnector.getTargetRepoId() );
        }
        configuration.removeProxyConnector( proxyConnectorConfiguration );
        saveConfiguration( configuration );
View Full Code Here

            indexCreators = mavenIndexerUtils.getAllIndexCreators();
            indexer = plexusSisuBridge.lookup( NexusIndexer.class );
        }
        catch ( PlexusSisuBridgeException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
        for ( RemoteRepository remoteRepository : getRemoteRepositories() )
        {
            createIndexContext( remoteRepository );
        }
View Full Code Here

                }
            }
        }
        catch ( IOException e )
        {
            throw new RepositoryAdminException( e.getMessage(), e );
        }
    }
View Full Code Here

        throws RepositoryAdminException
    {
        // validate source a Managed target a Remote
        if ( managedRepositoryAdmin.getManagedRepository( proxyConnector.getSourceRepoId() ) == null )
        {
            throw new RepositoryAdminException(
                "non valid ProxyConnector sourceRepo with id " + proxyConnector.getSourceRepoId()
                    + " is not a ManagedRepository" );
        }
        if ( remoteRepositoryAdmin.getRemoteRepository( proxyConnector.getTargetRepoId() ) == null )
        {
            throw new RepositoryAdminException(
                "non valid ProxyConnector sourceRepo with id " + proxyConnector.getTargetRepoId()
                    + " is not a RemoteRepository" );
        }

        // FIXME validate NetworkProxyConfiguration too when available
View Full Code Here

        getRepositoryCommonValidator().basicValidation( remoteRepository, false );

        //TODO we can validate it's a good uri/url
        if ( StringUtils.isEmpty( remoteRepository.getUrl() ) )
        {
            throw new RepositoryAdminException( "url cannot be null" );
        }

        //MRM-752 - url needs trimming
        remoteRepository.setUrl( StringUtils.trim( remoteRepository.getUrl() ) );
View Full Code Here

        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
            configuration.getRemoteRepositoriesAsMap().get( repositoryId );
        if ( remoteRepositoryConfiguration == null )
        {
            throw new RepositoryAdminException(
                "remoteRepository with id " + repositoryId + " not exist cannot remove it" );
        }

        configuration.removeRemoteRepository( remoteRepositoryConfiguration );
View Full Code Here

        RemoteRepositoryConfiguration remoteRepositoryConfiguration =
            configuration.getRemoteRepositoriesAsMap().get( repositoryId );
        if ( remoteRepositoryConfiguration == null )
        {
            throw new RepositoryAdminException(
                "remoteRepository with id " + repositoryId + " not exist cannot remove it" );
        }

        configuration.removeRemoteRepository( remoteRepositoryConfiguration );
View Full Code Here

TOP

Related Classes of org.apache.archiva.admin.model.RepositoryAdminException

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.