Package org.apache.maven.archiva.repository

Examples of org.apache.maven.archiva.repository.RemoteRepositoryContent


        requestProperties.setProperty( "version", artifact.getVersion() );

        List<ProxyConnector> connectors = getProxyConnectors( repository );
        for ( ProxyConnector connector : connectors )
        {
            RemoteRepositoryContent targetRepository = connector.getTargetRepository();
            String targetPath = targetRepository.toPath( artifact );

            try
            {
                File downloadedFile = transferFile( connector, targetRepository, targetPath, localFile,
                                                    requestProperties );

                if ( fileExists( downloadedFile ) )
                {
                    getLogger().debug( "Successfully transferred: " + downloadedFile.getAbsolutePath() );
                    return downloadedFile;
                }
            }
            catch ( NotFoundException e )
            {
                getLogger().debug( "Artifact " + Keys.toKey( artifact ) + " not found on repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( NotModifiedException e )
            {
                getLogger().debug( "Artifact " + Keys.toKey( artifact ) + " not updated on repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( ProxyException e )
            {
                getLogger().warn( "Transfer error from repository \"" + targetRepository.getRepository().getId() +
                    "\" for artifact " + Keys.toKey( artifact ) + ", continuing to next repository. Error message: " +
                    e.getMessage() );
                getLogger().debug( "Full stack trace", e );
            }
        }
View Full Code Here


        long originalTimestamp = getLastModified( localFile );

        List<ProxyConnector> connectors = getProxyConnectors( repository );
        for ( ProxyConnector connector : connectors )
        {
            RemoteRepositoryContent targetRepository = connector.getTargetRepository();
            String targetPath = metadataTools.toPath( metadata );

            File localRepoFile = toLocalRepoFile( repository, targetRepository, targetPath );
            long originalMetadataTimestamp = getLastModified( localRepoFile );

            try
            {
                transferFile( connector, targetRepository, targetPath, localRepoFile, requestProperties );

                if ( hasBeenUpdated( localRepoFile, originalMetadataTimestamp ) )
                {
                    metadataNeedsUpdating = true;
                }
            }
            catch ( NotFoundException e )
            {
                getLogger().debug( "Versioned Metadata " + Keys.toKey( metadata )
                                       + " not found on remote repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( NotModifiedException e )
            {
                getLogger().debug( "Versioned Metadata " + Keys.toKey( metadata )
                                       + " not updated on remote repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( ProxyException e )
            {
                getLogger().warn( "Transfer error from repository \"" + targetRepository.getRepository().getId() +
                    "\" for versioned Metadata " + Keys.toKey( metadata ) +
                    ", continuing to next repository. Error message: " + e.getMessage() );
                getLogger().debug( "Full stack trace", e );
            }
        }
View Full Code Here

        long originalTimestamp = getLastModified( localFile );

        List<ProxyConnector> connectors = getProxyConnectors( repository );
        for ( ProxyConnector connector : connectors )
        {
            RemoteRepositoryContent targetRepository = connector.getTargetRepository();
            String targetPath = metadataTools.toPath( metadata );

            File localRepoFile = toLocalRepoFile( repository, targetRepository, targetPath );
            long originalMetadataTimestamp = getLastModified( localRepoFile );
            try
            {
                transferFile( connector, targetRepository, targetPath, localRepoFile, requestProperties );

                if ( hasBeenUpdated( localRepoFile, originalMetadataTimestamp ) )
                {
                    metadataNeedsUpdating = true;
                }
            }
            catch ( NotFoundException e )
            {
                getLogger().debug( "Project Metadata " + Keys.toKey( metadata ) + " not found on remote repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( NotModifiedException e )
            {
                getLogger().debug( "Project Metadata " + Keys.toKey( metadata )
                                       + " not updated on remote repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( ProxyException e )
            {
                getLogger().warn( "Transfer error from repository \"" + targetRepository.getRepository().getId() +
                    "\" for project metadata " + Keys.toKey( metadata ) +
                    ", continuing to next repository. Error message: " + e.getMessage() );
                getLogger().debug( "Full stack trace", e );
            }
View Full Code Here

            if ( connector.isDisabled() )
            {
                continue;
            }

            RemoteRepositoryContent targetRepository = connector.getTargetRepository();
            requestProperties.setProperty( "remoteRepositoryId", targetRepository.getId() );

            String targetPath = targetRepository.toPath( artifact );

            try
            {
                File downloadedFile =
                    transferFile( connector, targetRepository, targetPath, repository, localFile, requestProperties,
                                  true );

                if ( fileExists( downloadedFile ) )
                {
                    log.debug( "Successfully transferred: " + downloadedFile.getAbsolutePath() );
                    return downloadedFile;
                }
            }
            catch ( NotFoundException e )
            {
                log.debug( "Artifact " + Keys.toKey( artifact ) + " not found on repository \""
                    + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( NotModifiedException e )
            {
                log.debug( "Artifact " + Keys.toKey( artifact ) + " not updated on repository \""
                    + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( ProxyException e )
            {
                validatePolicies( this.downloadErrorPolicies, connector.getPolicies(), requestProperties, artifact,
                                  targetRepository, localFile, e, previousExceptions );
View Full Code Here

            if ( connector.isDisabled() )
            {
                continue;
            }

            RemoteRepositoryContent targetRepository = connector.getTargetRepository();
            requestProperties.setProperty( "remoteRepositoryId", targetRepository.getId() );

            String targetPath = path;

            try
            {
                File downloadedFile =
                    transferFile( connector, targetRepository, targetPath, repository, localFile, requestProperties,
                                  false );

                if ( fileExists( downloadedFile ) )
                {
                    log.debug( "Successfully transferred: " + downloadedFile.getAbsolutePath() );
                    return downloadedFile;
                }
            }
            catch ( NotFoundException e )
            {
                log.debug( "Resource " + path + " not found on repository \""
                    + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( NotModifiedException e )
            {
                log.debug( "Resource " + path + " not updated on repository \""
                    + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( ProxyException e )
            {
                log.warn( "Transfer error from repository \"" + targetRepository.getRepository().getId()
                    + "\" for resource " + path + ", continuing to next repository. Error message: " + e.getMessage() );
                log.debug( "Full stack trace", e );
            }
        }
View Full Code Here

            if ( connector.isDisabled() )
            {
                continue;
            }

            RemoteRepositoryContent targetRepository = connector.getTargetRepository();

            File localRepoFile = toLocalRepoFile( repository, targetRepository, logicalPath );
            long originalMetadataTimestamp = getLastModified( localRepoFile );

            try
            {
                transferFile( connector, targetRepository, logicalPath, repository, localRepoFile, requestProperties,
                              true );

                if ( hasBeenUpdated( localRepoFile, originalMetadataTimestamp ) )
                {
                    metadataNeedsUpdating = true;
                }
            }
            catch ( NotFoundException e )
            {
                log.debug( "Metadata " + logicalPath + " not found on remote repository \""
                    + targetRepository.getRepository().getId() + "\".", e );
            }
            catch ( NotModifiedException e )
            {
                log.debug( "Metadata " + logicalPath + " not updated on remote repository \""
                    + targetRepository.getRepository().getId() + "\".", e );
            }
            catch ( ProxyException e )
            {
                log.warn( "Transfer error from repository \"" + targetRepository.getRepository().getId()
                    + "\" for versioned Metadata " + logicalPath + ", continuing to next repository. Error message: "
                    + e.getMessage() );
                log.debug( "Full stack trace", e );
            }
        }
View Full Code Here

        requestProperties.setProperty( "version", artifact.getVersion() );

        List<ProxyConnector> connectors = getProxyConnectors( repository );
        for ( ProxyConnector connector : connectors )
        {
            RemoteRepositoryContent targetRepository = connector.getTargetRepository();
            String targetPath = targetRepository.toPath( artifact );

            try
            {
                File downloadedFile = transferFile( connector, targetRepository, targetPath, localFile,
                                                    requestProperties );

                if ( fileExists( downloadedFile ) )
                {
                    getLogger().debug( "Successfully transferred: " + downloadedFile.getAbsolutePath() );
                    return downloadedFile;
                }
            }
            catch ( NotFoundException e )
            {
                getLogger().debug( "Artifact " + Keys.toKey( artifact ) + " not found on repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( NotModifiedException e )
            {
                getLogger().debug( "Artifact " + Keys.toKey( artifact ) + " not updated on repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
        }
        getLogger().debug( "Exhausted all target repositories, artifact " + Keys.toKey( artifact ) + " not found." );

        return null;
View Full Code Here

        long originalTimestamp = getLastModified( localFile );

        List<ProxyConnector> connectors = getProxyConnectors( repository );
        for ( ProxyConnector connector : connectors )
        {
            RemoteRepositoryContent targetRepository = connector.getTargetRepository();
            String targetPath = metadataTools.toPath( metadata );

            File localRepoFile = toLocalRepoFile( repository, targetRepository, targetPath );
            long originalMetadataTimestamp = getLastModified( localRepoFile );
           
            try
            {
                transferFile( connector, targetRepository, targetPath, localRepoFile, requestProperties );

                if ( hasBeenUpdated( localRepoFile, originalMetadataTimestamp ) )
                {
                    metadataNeedsUpdating = true;
                }
            }
            catch ( NotFoundException e )
            {
                getLogger().debug( "Versioned Metadata " + Keys.toKey( metadata )
                                       + " not found on remote repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( NotModifiedException e )
            {
                getLogger().debug( "Versioned Metadata " + Keys.toKey( metadata )
                                       + " not updated on remote repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
        }

        if ( hasBeenUpdated( localFile, originalTimestamp ) )
        {
View Full Code Here

        long originalTimestamp = getLastModified( localFile );

        List<ProxyConnector> connectors = getProxyConnectors( repository );
        for ( ProxyConnector connector : connectors )
        {
            RemoteRepositoryContent targetRepository = connector.getTargetRepository();
            String targetPath = metadataTools.toPath( metadata );

            File localRepoFile = toLocalRepoFile( repository, targetRepository, targetPath );
            long originalMetadataTimestamp = getLastModified( localRepoFile );
            try
            {
                transferFile( connector, targetRepository, targetPath, localRepoFile, requestProperties );
   
                if ( hasBeenUpdated( localRepoFile, originalMetadataTimestamp ) )
                {
                    metadataNeedsUpdating = true;
                }
            }
            catch ( NotFoundException e )
            {
                getLogger().debug( "Project Metadata " + Keys.toKey( metadata ) + " not found on remote repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
            catch ( NotModifiedException e )
            {
                getLogger().debug( "Project Metadata " + Keys.toKey( metadata )
                                       + " not updated on remote repository \""
                                       + targetRepository.getRepository().getId() + "\"." );
            }
           
        }

        if ( hasBeenUpdated( localFile, originalTimestamp ) )
View Full Code Here

    }

    public void testGetRepositorySpecificName()
        throws Exception
    {
        RemoteRepositoryContent repoJavaNet = createRemoteRepositoryContent( "maven2-repository.dev.java.net",
                                                                             "Java.net Repository for Maven 2",
                                                                             "http://download.java.net/maven/2/",
                                                                             "default" );
        RemoteRepositoryContent repoCentral = createRemoteRepositoryContent( "central", "Central Global Repository",
                                                                             "http://repo1.maven.org/maven2/",
                                                                             "default" );

        String convertedName = tools.getRepositorySpecificName( repoJavaNet,
                                                                "commons-lang/commons-lang/maven-metadata.xml" );
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.repository.RemoteRepositoryContent

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.