Examples of FileContentRecord


Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

    public void deleteArtifact( ManagedRepositoryContent repository, ArchivaArtifact artifact )
    {
        try
        {
            RepositoryContentIndex index = indexFactory.createFileContentIndex( repository.getRepository() );
            FileContentRecord fileContentRecord = new FileContentRecord();
            fileContentRecord.setRepositoryId( repository.getRepository().getId() );
            fileContentRecord.setFilename( repository.toPath( artifact ) );
            index.deleteRecord( fileContentRecord );

            index = indexFactory.createHashcodeIndex( repository.getRepository() );
            HashcodesRecord hashcodesRecord = new HashcodesRecord();
            fileContentRecord.setRepositoryId( repository.getRepository().getId() );
            hashcodesRecord.setArtifact( artifact );
            index.deleteRecord( hashcodesRecord );

            index = indexFactory.createBytecodeIndex( repository.getRepository() );
            BytecodeRecord bytecodeRecord = new BytecodeRecord();
            fileContentRecord.setRepositoryId( repository.getRepository().getId() );
            bytecodeRecord.setArtifact( artifact );
            index.deleteRecord( bytecodeRecord );
        }
        catch ( RepositoryIndexException e )
        {
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

    public void addHit( LuceneRepositoryContentRecord record )
    {
        if ( record instanceof FileContentRecord )
        {
            FileContentRecord filecontent = (FileContentRecord) record;
            addFileContentHit( filecontent );
        }
        else if ( record instanceof HashcodesRecord )
        {
            HashcodesRecord hashcodes = (HashcodesRecord) record;
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

            ArchivaArtifact artifact =
                new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(),
                                     reference.getClassifier(), reference.getType() );

            FileContentRecord fileContentRecord = new FileContentRecord();
            fileContentRecord.setFilename( repository.toPath( artifact ) );
            fileContentRecords.add( fileContentRecord );

            HashcodesRecord hashcodesRecord = new HashcodesRecord();
            hashcodesRecord.setArtifact( artifact );
            hashcodeRecords.add( hashcodesRecord );
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

    public void addHit( LuceneRepositoryContentRecord record )
    {
        if ( record instanceof FileContentRecord )
        {
            FileContentRecord filecontent = (FileContentRecord) record;
            addFileContentHit( filecontent );
        }
        else if ( record instanceof HashcodesRecord )
        {
            HashcodesRecord hashcodes = (HashcodesRecord) record;
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

    }

    public void processFile( String path )
        throws ConsumerException
    {
        FileContentRecord record = new FileContentRecord();
        try
        {
            File file = new File( repositoryDir, path );
            record.setRepositoryId( this.repository.getId() );
            record.setFilename( path );
            record.setContents( FileUtils.readFileToString( file, null ) );

            // Test for possible artifact reference syntax.
            try
            {
                ArtifactReference ref = repository.toArtifactReference( path );
                ArchivaArtifact artifact = new ArchivaArtifact( ref );
                record.setArtifact( artifact );
            }
            catch ( LayoutException e )
            {
                // Not an artifact.
            }
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

        if ( !pathToFile.exists() )
        {
            throw new AssertionFailedError( "Can't find test file: " + pathToFile.getAbsolutePath() );
        }

        FileContentRecord record = new FileContentRecord();
        record.setRepositoryId( "test-repo" );
        record.setFilename( path );

        try
        {
            record.setContents( FileUtils.readFileToString( pathToFile, null ) );
        }
        catch ( IOException e )
        {
            e.printStackTrace();
            throw new AssertionFailedError( "Can't load test file contents: " + pathToFile.getAbsolutePath() );
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

               
                ArchivaArtifact artifact =
                    new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(),
                                         reference.getClassifier(), reference.getType() );
   
                FileContentRecord fileContentRecord = new FileContentRecord();
                fileContentRecord.setFilename( repository.toPath( artifact ) );
                fileContentRecords.add( fileContentRecord );
   
                HashcodesRecord hashcodesRecord = new HashcodesRecord();
                hashcodesRecord.setArtifact( artifact );
                hashcodeRecords.add( hashcodesRecord );
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

                RepositoryContentIndex bytecodeIndex = repoIndexFactory.createBytecodeIndex( repoContent.getRepository() );
                RepositoryContentIndex hashcodesIndex = repoIndexFactory.createHashcodeIndex( repoContent.getRepository() );
                RepositoryContentIndex fileContentIndex =
                    repoIndexFactory.createFileContentIndex( repoContent.getRepository() );
   
                FileContentRecord fileContentRecord = new FileContentRecord();
                fileContentRecord.setFilename( repoContent.toPath( artifact ) );
                fileContentIndex.deleteRecord( fileContentRecord );
   
                HashcodesRecord hashcodesRecord = new HashcodesRecord();
                hashcodesRecord.setArtifact( artifact );
                hashcodesIndex.deleteRecord( hashcodesRecord );
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

        {
            log.debug( "File is a metadata file. Not indexing." );
            return;
        }
       
        FileContentRecord record = new FileContentRecord();
        try
        {
            File file = new File( repositoryDir, path );
            record.setRepositoryId( this.repository.getId() );
            record.setFilename( path );
            record.setContents( FileUtils.readFileToString( file, null ) );

            // Test for possible artifact reference syntax.
            try
            {
                ArtifactReference ref = repository.toArtifactReference( path );
                ArchivaArtifact artifact = new ArchivaArtifact( ref );
                artifact.getModel().setRepositoryId( repository.getId() );
                record.setArtifact( artifact );               
            }
            catch ( LayoutException e )
            {
                // Not an artifact.
            }
View Full Code Here

Examples of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

    public void addHit( LuceneRepositoryContentRecord record )
    {
        if ( record instanceof FileContentRecord )
        {
            FileContentRecord filecontent = (FileContentRecord) record;
            addFileContentHit( filecontent );
        }
        else if ( record instanceof HashcodesRecord )
        {
            HashcodesRecord hashcodes = (HashcodesRecord) record;
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.