Package org.apache.archiva.metadata.repository.storage.maven2

Examples of org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator


        artifactMetadata.setNamespace( ARCHIVA_TEST_GROUP_ID );
        artifactMetadata.setMd5( CHECKSUM );
        artifactMetadata.setWhenGathered( whenGathered );
        artifactMetadata.setRepositoryId( TEST_REPO );

        MavenArtifactFacet facet = new MavenArtifactFacet();
        facet.setType( "jar" );
        artifactMetadata.addFacet( facet );

        return artifactMetadata;
    }
View Full Code Here


    private String getTypeFromArtifactId( String artifactId )
    {
        ArtifactMetadata artifact = pathTranslator.getArtifactFromId( null, "groupId", artifactId, "1.0",
                                                                      artifactId + "-1.0.jar" );
        MavenArtifactFacet facet = (MavenArtifactFacet) artifact.getFacet( MavenArtifactFacet.FACET_ID );
        return facet.getType();
    }
View Full Code Here

                                                                                       version ) )
                    {
                        stats.setTotalArtifactCount( stats.getTotalArtifactCount() + 1 );
                        stats.setTotalArtifactFileSize( stats.getTotalArtifactFileSize() + artifact.getSize() );

                        MavenArtifactFacet facet = (MavenArtifactFacet) artifact.getFacet(
                            MavenArtifactFacet.FACET_ID );
                        if ( facet != null )
                        {
                            String type = facet.getType();
                            stats.setTotalCountForType( type, stats.getTotalCountForType( type ) + 1 );
                        }
                    }
                }
            }
View Full Code Here

            path = path.substring( 0, path.lastIndexOf( "/" ) + 1 ) + artifact.getId();

            // TODO: need to accommodate Maven 1 layout too. Non-maven repository formats will need to generate this
            // facet (perhaps on the fly) if wanting to display the Maven 2 elements on the Archiva pages
            String type = null;
            MavenArtifactFacet facet = (MavenArtifactFacet) artifact.getFacet( MavenArtifactFacet.FACET_ID );
            if ( facet != null )
            {
                type = facet.getType();
            }
            this.type = type;

            namespace = artifact.getNamespace();
            project = artifact.getProject();
View Full Code Here

        ArtifactReference artifact = new ArtifactReference();
        artifact.setGroupId( metadata.getNamespace() );
        artifact.setArtifactId( metadata.getProject() );
        artifact.setVersion( metadata.getVersion() );
        MavenArtifactFacet facet = (MavenArtifactFacet) metadata.getFacet( MavenArtifactFacet.FACET_ID );
        if ( facet != null )
        {
            artifact.setClassifier( facet.getClassifier() );
            artifact.setType( facet.getType() );
        }

        return artifact;
    }
View Full Code Here

                                                                                       version ) )
                    {
                        stats.setTotalArtifactCount( stats.getTotalArtifactCount() + 1 );
                        stats.setTotalArtifactFileSize( stats.getTotalArtifactFileSize() + artifact.getSize() );

                        MavenArtifactFacet facet = (MavenArtifactFacet) artifact.getFacet(
                            MavenArtifactFacet.FACET_ID );
                        if ( facet != null )
                        {
                            String type = facet.getType();
                            stats.setTotalCountForType( type, stats.getTotalCountForType( type ) + 1 );
                        }
                    }
                }
            }
View Full Code Here

        metadata.setSize( 12345L );
        metadata.setProjectVersion( projectVersion );
        metadata.setVersion( projectVersion );
        metadata.setNamespace( namespace );

        MavenArtifactFacet facet = new MavenArtifactFacet();
        facet.setType( type );
        metadata.addFacet( facet );

        return metadata;
    }
View Full Code Here

    private String getTypeFromArtifactId( String artifactId )
    {
        ArtifactMetadata artifact = pathTranslator.getArtifactFromId( null, "groupId", artifactId, "1.0",
                                                                      artifactId + "-1.0.jar" );
        MavenArtifactFacet facet = (MavenArtifactFacet) artifact.getFacet( MavenArtifactFacet.FACET_ID );
        return facet.getType();
    }
View Full Code Here

        metadata.setRepositoryId( TEST_REPO );
        metadata.setSize( TEST_SIZE );
        metadata.setProjectVersion( VersionUtil.getBaseVersion( version ) );
        metadata.setVersion( version );

        MavenArtifactFacet facet = new MavenArtifactFacet();
        facet.setType( "jar" );
        facet.setTimestamp( timestamp );
        facet.setBuildNumber( buildNumber );
        metadata.addFacet( facet );

        return metadata;
    }
View Full Code Here

                        {
                            throw new ArchivaRestServiceException(
                                "You must configure a type/packaging when using classifier", 400, null );
                        }
                        // cleanup facet which contains classifier information
                        MavenArtifactFacet mavenArtifactFacet =
                            (MavenArtifactFacet) artifactMetadata.getFacet( MavenArtifactFacet.FACET_ID );

                        if ( StringUtils.equals( artifact.getClassifier(), mavenArtifactFacet.getClassifier() ) )
                        {
                            artifactMetadata.removeFacet( MavenArtifactFacet.FACET_ID );
                            String groupId = artifact.getGroupId(), artifactId = artifact.getArtifactId(), version =
                                artifact.getVersion();
                            //metadataRepository.updateArtifact( repositoryId, groupId, artifactId, version,
                            //                                   artifactMetadata );
                            // String repositoryId, String namespace, String project, String version, String projectId, MetadataFacet metadataFacet
                            MavenArtifactFacet mavenArtifactFacetToCompare = new MavenArtifactFacet();
                            mavenArtifactFacetToCompare.setClassifier( artifact.getClassifier() );
                            metadataRepository.removeArtifact( repositoryId, groupId, artifactId, version,
                                                               mavenArtifactFacetToCompare );
                            metadataRepository.save();
                        }
View Full Code Here

TOP

Related Classes of org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator

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.