Package org.apache.maven.archiva.configuration

Examples of org.apache.maven.archiva.configuration.FileType


        }

        String id = getFileTypeId();
        String pattern = getPattern();

        FileType filetype = findFileType( id );
        if ( filetype == null )
        {
            addActionError( "Pattern not added, unable to find filetype " + id );
            return INPUT;
        }

        if ( filetype.getPatterns().contains( pattern ) )
        {
            addActionError( "Not adding pattern \"" + pattern + "\" to filetype " + id + " as it already exists." );
            return INPUT;
        }

        filetype.addPattern( pattern );
        addActionMessage( "Added pattern \"" + pattern + "\" to filetype " + id );

        return saveConfiguration();
    }
View Full Code Here


        if ( !isValidFiletypeCommand() )
        {
            return INPUT;
        }

        FileType filetype = findFileType( getFileTypeId() );
        if ( filetype == null )
        {
            addActionError( "Pattern not removed, unable to find filetype " + getFileTypeId() );
            return INPUT;
        }

        filetype.removePattern( getPattern() );

        return saveConfiguration();
    }
View Full Code Here

    {
        boolean satisfies = false;

        if ( object instanceof FileType )
        {
            FileType filetype = (FileType) object;
            return ( StringUtils.equals( filetypeId, filetype.getId() ) );
        }

        return satisfies;
    }
View Full Code Here

    public void execute( Object input )
    {
        if ( input instanceof FileType )
        {
            FileType filetype = (FileType) input;
            map.put( filetype.getId(), filetype );
        }
    }
View Full Code Here

        File repoDir = getTestFile( "src/test/repositories/default-repository" );

        ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir );

        ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE );
        FileType fileType = (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 );
        fileType.addPattern( "**/*.xml" );
        assertEquals( FileTypes.ARTIFACTS, fileType.getId() );

        FileTypes fileTypes = (FileTypes) lookup( FileTypes.class );
        fileTypes.afterConfigurationChange( null, "fileType", null );

        repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" );
View Full Code Here

    private void assertNotConsumed( String path )
        throws Exception
    {
        ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE );
        FileType fileType =
            (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 );
        assertEquals( FileTypes.ARTIFACTS, fileType.getId() );
        fileType.addPattern( "**/*.xml" );

        // trigger reload
        FileTypes fileTypes = (FileTypes) lookup( FileTypes.class );
        fileTypes.afterConfigurationChange( null, "repositoryScanning.fileTypes", null );

View Full Code Here

        throws Exception
    {
        super.setUp();

        ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE );
        FileType fileType =
            (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 );
        assertEquals( FileTypes.ARTIFACTS, fileType.getId() );
        fileType.addPattern( "**/*.xml" );

        repoLocation = getTestFile( "target/test-" + getName() + "/test-repo" );

        consumer =
            (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class, "update-db-artifact" );
View Full Code Here

        throws Exception
    {
        super.setUp();

        ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE );
        FileType fileType =
            (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 );
        assertEquals( FileTypes.ARTIFACTS, fileType.getId() );
        fileType.addPattern( "**/*.xml" );

        repoLocation = getTestFile( "target/test-" + getName() + "/test-repo" );
    }
View Full Code Here

    private void assertNotConsumed( String path )
        throws Exception
    {
        ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE );
        FileType fileType =
            (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 );
        assertEquals( FileTypes.ARTIFACTS, fileType.getId() );
        fileType.addPattern( "**/*.xml" );

        // trigger reload
        FileTypes fileTypes = (FileTypes) lookup( FileTypes.class );
        fileTypes.afterConfigurationChange( null, "repositoryScanning.fileTypes", null );

View Full Code Here

    private void assertNotConsumed( String path )
        throws Exception
    {
        ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE );
        FileType fileType =
            (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 );
        assertEquals( FileTypes.ARTIFACTS, fileType.getId() );
        fileType.addPattern( "**/*.xml" );

        // trigger reload
        FileTypes fileTypes = (FileTypes) lookup( FileTypes.class );
        fileTypes.afterConfigurationChange( null, "repositoryScanning.fileTypes", null );

View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.configuration.FileType

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.