Examples of ArchivaArtifact


Examples of org.apache.archiva.model.ArchivaArtifact

            for ( String repoId : selectedRepos )
            {

                ManagedRepositoryContent managedRepositoryContent =
                    repositoryContentFactory.getManagedRepositoryContent( repoId );
                ArchivaArtifact archivaArtifact = new ArchivaArtifact( groupId, artifactId, version, classifier,
                                                                       StringUtils.isEmpty( type ) ? "jar" : type,
                                                                       repoId );
                File file = managedRepositoryContent.toFile( archivaArtifact );
                if ( file.exists() )
                {
View Full Code Here

Examples of org.apache.archiva.model.ArchivaArtifact

            for ( String repoId : selectedRepos )
            {

                ManagedRepositoryContent managedRepositoryContent =
                    repositoryContentFactory.getManagedRepositoryContent( repoId );
                ArchivaArtifact archivaArtifact = new ArchivaArtifact( groupId, artifactId, version, classifier,
                                                                       StringUtils.isEmpty( type ) ? "jar" : type,
                                                                       repoId );
                File file = managedRepositoryContent.toFile( archivaArtifact );
                if ( !file.exists() )
                {
View Full Code Here

Examples of org.apache.archiva.model.ArchivaArtifact

                    continue;
                }
                ManagedRepositoryContent managedRepositoryContent =
                    repositoryContentFactory.getManagedRepositoryContent( repoId );
                // FIXME default to jar which can be wrong for war zip etc....
                ArchivaArtifact archivaArtifact = new ArchivaArtifact( groupId, artifactId, version,
                                                                       StringUtils.isEmpty( classifier )
                                                                           ? ""
                                                                           : classifier, "jar", repoId
                );
                File file = managedRepositoryContent.toFile( archivaArtifact );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

    public ArchivaProjectModel selectVersion( String principle, List<String> observableRepositoryIds, String groupId,
                                              String artifactId, String version )
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        ArchivaArtifact pomArtifact = getArtifact( principle, observableRepositoryIds, groupId, artifactId, version );

        ArchivaProjectModel model;
        version = pomArtifact.getVersion();

        if ( !pomArtifact.getModel().isProcessed() )
        {
            // Process it.
            dbUpdater.updateUnprocessed( pomArtifact );
        }
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

    private ArchivaArtifact getArtifact( String principle, List<String> observableRepositoryIds, String groupId,
                                         String artifactId, String version )
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        ArchivaArtifact pomArtifact = null;

        try
        {
            pomArtifact = dao.getArtifactDAO().getArtifact( groupId, artifactId, version, null, "pom" );
        }
        catch ( ObjectNotFoundException e )
        {
            pomArtifact = handleGenericSnapshots( groupId, artifactId, version, pomArtifact );
        }

        if ( pomArtifact == null )
        {
            throw new ObjectNotFoundException( "Unable to find artifact [" + Keys.toKey( groupId, artifactId, version )
                + "]" );
        }

        // Allowed to see this?
        if ( observableRepositoryIds.contains( pomArtifact.getModel().getRepositoryId() ) )
        {
            return pomArtifact;
        }
        else
        {
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

        if ( observableRepositoryIds.isEmpty() )
        {
            throw new ArchivaDatabaseException( "There are no observable repositories for the user " + principal );
        }

        ArchivaArtifact pomArtifact = getArtifact( principal, observableRepositoryIds, groupId, artifactId, version );
        ArchivaProjectModel model;

        if ( !pomArtifact.getModel().isProcessed() )
        {
            // Process it.
            dbUpdater.updateUnprocessed( pomArtifact );
        }

        model = getProjectModel( groupId, artifactId, pomArtifact.getVersion() );

        if ( model.getPackaging() == null || "".equals( model.getPackaging() ) )
        {
            model.setPackaging( pomArtifact.getType() );
        }

        return model;
    }
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

            throw new ArchivaDatabaseException( "There are no observable repositories for the user " + principal );
        }

        try
        {
            ArchivaArtifact pomArchivaArtifact =
                getArtifact( principal, observableRepositoryIds, groupId, artifactId, version );

            return pomArchivaArtifact.getModel().getRepositoryId();
        }
        catch ( ObjectNotFoundException e )
        {
            return getNoPomArtifactRepoId( principal, observableRepositoryIds, groupId, artifactId, version,
                                           observableRepositoryIds.get( 0 ) );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

    private ArchivaArtifact getArtifact( final String principal, final List<String> observableRepositoryIds,
                                         final String groupId, final String artifactId, final String version )
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        ArchivaArtifact pomArtifact = null;
        Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version );

        try
        {
            List<ArchivaArtifact> artifacts = dao.getArtifactDAO().queryArtifacts( constraint );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

    @SuppressWarnings("unchecked")
    private ArchivaArtifact handleGenericSnapshots( final String groupId, final String artifactId,
                                                    final String version, final String repositoryId )
        throws ArchivaDatabaseException
    {
        ArchivaArtifact result = null;

        if ( VersionUtil.isGenericSnapshot( version ) )
        {
            final List<String> versions = (List<String>) dao.query( new UniqueVersionConstraint( groupId, artifactId ) );
            Collections.sort( versions );
View Full Code Here

Examples of org.apache.maven.archiva.model.ArchivaArtifact

    private String getNoPomArtifactRepoId( String principal, List<String> observableRepos, String groupId,
                                           String artifactId, String version, String repositoryId )
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        ArchivaArtifact artifact = null;

        String type = getArtifactType( groupId, artifactId, version );

        artifact = dao.getArtifactDAO().createArtifact( groupId, artifactId, version, null, type, repositoryId );

        if ( artifact == null )
        {
            // Lets not persist these
            artifact = new ArchivaArtifact( groupId, artifactId, version, null, type, repositoryId );
        }

        // Allowed to see this?
        if ( !observableRepos.contains( artifact.getModel().getRepositoryId() ) )
        {
            throw new ObjectNotFoundException( "Unable to find artifact " + Keys.toKey( groupId, artifactId, version ) +
                " in observable repository [" + StringUtils.join( observableRepos.iterator(), ", " ) + "] for user " +
                principal );
        }

        return artifact.getModel().getRepositoryId();
    }
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.