Examples of BidirectionalRepositoryLayout


Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

    private RepositoryProjectResolver toResolver( ArchivaRepository repo )
        throws RepositoryException
    {
        try
        {
            BidirectionalRepositoryLayout layout = layoutFactory.getLayout( repo.getLayoutType() );
            ProjectModelReader reader = project400Reader;

            if ( StringUtils.equals( "legacy", repo.getLayoutType() ) )
            {
                reader = project300Reader;
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

    }

    public void beginScan( ArchivaRepository repository )
        throws ConsumerException
    {
        BidirectionalRepositoryLayout repositoryLayout;
        try
        {
            repositoryLayout = layoutFactory.getLayout( repository.getLayoutType() );
        }
        catch ( LayoutException e )
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

        ArchivaRepository repo = new ArchivaRepository( "defaultTestRepo", "Default Test Repo", "file://"
            + defaultRepoDir.getAbsolutePath() );

        ProjectModelReader reader = new ProjectModel400Reader();
        BidirectionalRepositoryLayout layout = new DefaultBidirectionalRepositoryLayout();
        RepositoryProjectResolver resolver = new RepositoryProjectResolver( repo, reader, layout );

        return resolver;
    }
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

    private String toPath( ArchivaArtifact artifact )
    {
        try
        {
            BidirectionalRepositoryLayout layout = layoutFactory.getLayout( artifact );
            return layout.toPath( artifact );
        }
        catch ( LayoutException e )
        {
            getLogger().warn( "Unable to calculate path for artifact: " + artifact );
            return "";
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

            if ( relatedArtifacts != null )
            {
                String repoId = ( (ArchivaArtifact) relatedArtifacts.get( 0 ) ).getModel().getRepositoryId();
                ArchivaRepository repo = dao.getRepositoryDAO().getRepository( repoId );
                BidirectionalRepositoryLayout layout = layoutFactory.getLayout( repo.getLayoutType() );

                String prefix = req.getContextPath() + "/repository/" + repoId;

                if ( mini )
                {
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

    }

    protected ArtifactReference createArtifactReference( String layoutType, String path )
        throws Exception
    {
        BidirectionalRepositoryLayout layout = layoutFactory.getLayout( layoutType );
        ArchivaArtifact artifact = layout.toArtifact( path );
        ArtifactReference ref = new ArtifactReference();
        ref.setGroupId( artifact.getGroupId() );
        ref.setArtifactId( artifact.getArtifactId() );
        ref.setVersion( artifact.getVersion() );
        ref.setClassifier( artifact.getClassifier() );
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

    }

    protected ProjectReference createMetadataReference( String layoutType, String path )
        throws Exception
    {
        BidirectionalRepositoryLayout layout = layoutFactory.getLayout( layoutType );
        ProjectReference metadata = layout.toProjectReference( path );
        return metadata;
    }
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

    private String toPath( ArchivaArtifact artifact )
    {
        try
        {
            BidirectionalRepositoryLayout layout = layoutFactory.getLayout( artifact );
            return layout.toPath( artifact );
        }
        catch ( LayoutException e )
        {
            getLogger().warn( "Unable to calculate path for artifact: " + artifact );
            return null;
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

        }

        File localFile;
        try
        {
            BidirectionalRepositoryLayout sourceLayout = layoutFactory.getLayout( repository.getLayoutType() );
            String sourcePath = sourceLayout.toPath( artifact );
            localFile = new File( repository.getUrl().getPath(), sourcePath );
        }
        catch ( LayoutException e )
        {
            throw new ProxyException( "Unable to proxy due to bad source repository layout definition: "
                + e.getMessage(), e );
        }

        Properties requestProperties = new Properties();
        requestProperties.setProperty( "version", artifact.getVersion() );

        List connectors = getProxyConnectors( repository );
        Iterator it = connectors.iterator();
        while ( it.hasNext() )
        {
            ProxyConnector connector = (ProxyConnector) it.next();
            getLogger().debug( "Attempting connector: " + connector );
            ArchivaRepository targetRepository = connector.getTargetRepository();
            try
            {
                BidirectionalRepositoryLayout targetLayout = layoutFactory.getLayout( targetRepository.getLayoutType() );
                String targetPath = targetLayout.toPath( artifact );

                getLogger().debug(
                                   "Using target repository: " + targetRepository.getId() + " - layout: "
                                       + targetRepository.getLayoutType() + " - targetPath: " + targetPath );
View Full Code Here

Examples of org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout

        }

        File localFile;
        try
        {
            BidirectionalRepositoryLayout sourceLayout = layoutFactory.getLayout( repository.getLayoutType() );
            String sourcePath = sourceLayout.toPath( metadata );
            localFile = new File( repository.getUrl().getPath(), sourcePath );
        }
        catch ( LayoutException e )
        {
            throw new ProxyException( "Unable to proxy due to bad source repository layout definition: "
                + e.getMessage(), e );
        }

        Properties requestProperties = new Properties();

        List connectors = getProxyConnectors( repository );
        Iterator it = connectors.iterator();
        while ( it.hasNext() )
        {
            ProxyConnector connector = (ProxyConnector) it.next();
            ArchivaRepository targetRepository = connector.getTargetRepository();
            try
            {
                BidirectionalRepositoryLayout targetLayout = layoutFactory.getLayout( targetRepository.getLayoutType() );
                String targetPath = targetLayout.toPath( metadata );

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

                if ( fileExists( downloadedFile ) )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.