Package org.apache.maven.archiva.common.utils

Examples of org.apache.maven.archiva.common.utils.BaseFile


    {
        File localFile =
            new File( repoLocation, "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata-central.xml" );

        ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate();
        BaseFile baseFile = new BaseFile( repoLocation, localFile );
        predicate.setBasefile( baseFile );

        assertFalse( predicate.evaluate( consumer ) );
    }
View Full Code Here


    {
        File localFile =
            new File( repoLocation, "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata.xml" );

        ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate();
        BaseFile baseFile = new BaseFile( repoLocation, localFile );
        predicate.setBasefile( baseFile );

        assertFalse( predicate.evaluate( consumer ) );
    }
View Full Code Here

    {
        File localFile =
            new File( repoLocation, "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata-central.xml" );

        ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate();
        BaseFile baseFile = new BaseFile( repoLocation, localFile );
        predicate.setBasefile( baseFile );

        assertFalse( predicate.evaluate( consumer ) );
    }
View Full Code Here

        File localFile =
            new File( repoLocation, path );

        ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate();
        BaseFile baseFile = new BaseFile( repoLocation, localFile );
        predicate.setBasefile( baseFile );

        assertFalse( predicate.evaluate( repoPurgeConsumer ) );
    }
View Full Code Here

        log.info( "Walk started [" + this.repository.getId() + "] " + this.repository.getLocation() );
    }

    public void directoryWalkStep( int percentage, File file )
    {
        BaseFile basefile = new BaseFile( repository.getLocation(), file );
        purgeController.doPurge( basefile.getRelativePath() );
    }
View Full Code Here

        for ( Iterator it = files.iterator(); it.hasNext(); )
        {
            String path = (String) it.next();
            try
            {
                mockConsumer.processFile( new BaseFile( repository.getBasedir(), path ) );
            }
            catch ( ConsumerException e )
            {
                mockConsumer.getProblemsTracker().addProblem( e );
            }
View Full Code Here

        for ( Iterator it = files.iterator(); it.hasNext(); )
        {
            String path = (String) it.next();
            try
            {
                mockConsumer.processFile( new BaseFile( repository.getBasedir(), path ) );
            }
            catch ( ConsumerException e )
            {
                mockConsumer.getProblemsTracker().addProblem( e );
            }
View Full Code Here

        synchronized ( consumers )
        {
            stats.filesIncluded++;

            BaseFile basefile = new BaseFile( repository.getBasedir(), file );

            Iterator itConsumers = this.consumers.iterator();
            while ( itConsumers.hasNext() )
            {
                Consumer consumer = (Consumer) itConsumers.next();

                if ( wantsFile( consumer, StringUtils.replace( basefile.getRelativePath(), "\\", "/" ) ) )
                {
                    try
                    {
                        log.debug( "Sending to consumer: " + consumer.getName() );
                        stats.filesConsumed++;
                        consumer.processFile( basefile );
                    }
                    catch ( Exception e )
                    {
                        /* Intentionally Catch all exceptions.
                         * So that the discoverer processing can continue.
                         */
                        log.error( "Consumer [" + consumer.getName() + "] had an error when processing file [" +
                            basefile.getAbsolutePath() + "]: " + e.getMessage(), e );
                    }
                }
                else
                {
                    log.debug(
                        "Skipping consumer " + consumer.getName() + " for file " + basefile.getRelativePath() );
                }
            }
        }
    }
View Full Code Here

            System.out.println( "Base Dir:" + stats.getRepository().getBasedir() );
            int num = 0;
            Iterator it = mockConsumer.getFilesProcessed().iterator();
            while ( it.hasNext() )
            {
                BaseFile file = (BaseFile) it.next();
                System.out.println( "  Processed File [" + num + "]: " + file.getRelativePath() );
                num++;
            }

            fail( "Files Processed mismatch: expected:<" + expectedFileCount + ">, actual:<" + actualFileCount + ">" );
        }
View Full Code Here

        synchronized ( consumers )
        {
            stats.filesIncluded++;

            BaseFile basefile = new BaseFile( repository.getBasedir(), file );

            Iterator itConsumers = this.consumers.iterator();
            while ( itConsumers.hasNext() )
            {
                Consumer consumer = (Consumer) itConsumers.next();

                if ( wantsFile( consumer, StringUtils.replace( basefile.getRelativePath(), "\\", "/" ) ) )
                {
                    try
                    {
                        getLogger().debug( "Sending to consumer: " + consumer.getName() );
                        stats.filesConsumed++;
                        consumer.processFile( basefile );
                    }
                    catch ( Exception e )
                    {
                        /* Intentionally Catch all exceptions.
                         * So that the discoverer processing can continue.
                         */
                        getLogger().error( "Consumer [" + consumer.getName() + "] had an error when processing file [" +
                            basefile.getAbsolutePath() + "]: " + e.getMessage(), e );
                    }
                }
                else
                {
                    getLogger().debug(
                        "Skipping consumer " + consumer.getName() + " for file " + basefile.getRelativePath() );
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.common.utils.BaseFile

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.