Package org.apache.maven.archiva.indexer.filecontent

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
            {
                ArchivaArtifact artifact = this.repositoryLayout.toArtifact( path );
                record.setArtifact( artifact );
            }
            catch ( LayoutException e )
            {
                // Not an artifact.
            }
View Full Code Here


        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

    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

    }

    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
            {
                ArchivaArtifact artifact = this.repositoryLayout.toArtifact( path );
                record.setArtifact( artifact );
            }
            catch ( LayoutException e )
            {
                // Not an artifact.
            }
View Full Code Here

        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

    }

    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
            {
                ArchivaArtifact artifact = this.repositoryLayout.toArtifact( path );
                record.setArtifact( artifact );
            }
            catch ( LayoutException e )
            {
                // Not an artifact.
            }
View Full Code Here

    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

        {
            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

    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

        {
            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 );
                record.setArtifact( artifact );
            }
            catch ( LayoutException e )
            {
                // Not an artifact.
            }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.indexer.filecontent.FileContentRecord

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.