Package org.sonatype.nexus.index

Examples of org.sonatype.nexus.index.ArtifactInfo


 
    public void populateArtifactInfo( ArtifactIndexingContext context ) throws IOException
    {
        ArtifactContext artifactContext = context.getArtifactContext();
       
        ArtifactInfo ai = artifactContext.getArtifactInfo();

        File artifactFile = artifactContext.getArtifact();

        if ( artifactFile != null && artifactFile.exists() && artifactFile.getName().endsWith( ".jar" ) )
        {
View Full Code Here


        }
    }
 
    public void updateDocument( ArtifactIndexingContext context, Document doc )
    {
        ArtifactInfo ai = context.getArtifactContext().getArtifactInfo();

        if ( ai.classNames != null )
        {
            doc.add( new Field( ArtifactInfo.NAMES, ai.classNames, Field.Store.COMPRESS, Field.Index.TOKENIZED ) );
        }
View Full Code Here

    //

    private Term getKeyTerm( ArtifactContext ac )
    {
        ArtifactInfo ai = ac.getArtifactInfo();
       
        return new Term( ArtifactInfo.UINFO, //
            AbstractIndexCreator.getGAV( ai.groupId, ai.artifactId, ai.version, ai.classifier ) );
    }
View Full Code Here

    }

    private Document createDocument( IndexingContext context, ArtifactContext ac )
        throws IOException
    {
        ArtifactInfo ai = ac.getArtifactInfo();
     
        Document doc = new Document();

        // primary key
        doc.add( new Field(
View Full Code Here

        File artifact = artifactContext.getArtifact();

        File pom = artifactContext.getPom();

        ArtifactInfo ai = artifactContext.getArtifactInfo();

        if ( pom != null )
        {
            Model model = modelReader.readModel( pom, ai.groupId, ai.artifactId, ai.version );
View Full Code Here

        }
    }

    public void updateDocument( ArtifactIndexingContext context, Document doc )
    {
        ArtifactInfo ai = context.getArtifactContext().getArtifactInfo();

        String info = new StringBuilder() //
            .append( ai.packaging ).append( AbstractIndexCreator.FS ) //
            .append( Long.toString( ai.lastModified ) ).append( AbstractIndexCreator.FS ) //
            .append( Long.toString( ai.size ) ).append( AbstractIndexCreator.FS ) //
View Full Code Here

        assertFalse( new File( repositoryConfig.getLocation(), ".index" ).exists() );
        assertEquals( 1, response.getTotalHits() );

        Set<ArtifactInfo> results = response.getResults();

        ArtifactInfo artifactInfo = (ArtifactInfo) results.iterator().next();
        assertEquals( "org.apache.archiva", artifactInfo.groupId );
        assertEquals( "archiva-index-methods-jar-test", artifactInfo.artifactId );
        assertEquals( "test-repo", artifactInfo.repository );

        context.close( true );
View Full Code Here

        assertEquals( 1, response.getTotalHits() );

        Set<ArtifactInfo> results = response.getResults();

        ArtifactInfo artifactInfo = (ArtifactInfo) results.iterator().next();
        assertEquals( "org.apache.archiva", artifactInfo.groupId );
        assertEquals( "archiva-index-methods-jar-test", artifactInfo.artifactId );
        assertEquals( "test-repo", artifactInfo.repository );

        context.close( true );
View Full Code Here

        assertTrue( new File( repositoryConfig.getLocation(), ".index" ).exists() );
        assertEquals( 1, response.getTotalHits() );
       
        Set<ArtifactInfo> results = response.getResults();
       
        ArtifactInfo artifactInfo = (ArtifactInfo) results.iterator().next();
        assertEquals( "org.apache.archiva", artifactInfo.groupId );
        assertEquals( "archiva-index-methods-jar-test", artifactInfo.artifactId );
        assertEquals( "test-repo", artifactInfo.repository )
    }
View Full Code Here

                                        NexusIndexer.FULL_INDEX, false );

        File artifactFile =
            new File( repositoryConfig.getLocation(),
                      "org/apache/archiva/archiva-lucene-consumers/1.2/archiva-lucene-consumers-1.2.jar" );
        ArtifactInfo ai = new ArtifactInfo( "test-repo", "org.apache.archiva", "archiva-lucene-consumers", "1.2", null );

        repoFactoryControl.expectAndReturn( repoFactory.getManagedRepositoryContent( repositoryConfig.getId() ),
                                            repoContent );
        indexerControl.expectAndReturn( indexer.addIndexingContext( repositoryConfig.getId(), repositoryConfig.getId(),
                                                                    new File( repositoryConfig.getLocation() ),
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.index.ArtifactInfo

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.