Package org.apache.maven.archiva.configuration

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


    {
        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

        }

        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 );
       
        triggerAuditEvent( AuditEvent.ADD_PATTERN + " " + pattern );

        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() );
       
        triggerAuditEvent( AuditEvent.REMOVE_PATTERN + " " + pattern );

        return saveConfiguration();
    }
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

                int count = 0;
                for ( Iterator iter = value.getFileTypes().iterator(); iter.hasNext(); count++ )
                {
                    String name = "fileTypes.fileType(" + count + ")";
                    FileType o = ( FileType ) iter.next();
                    writeFileType( prefix + name + ".", o, registry );
                }
            }
            if ( value.getKnownContentConsumers() != null && value.getKnownContentConsumers().size() > 0
)
View Full Code Here

        java.util.List fileTypes = new java.util.ArrayList();
        List fileTypesSubsets = registry.getSubsetList( prefix + "fileTypes.fileType" );
        for ( Iterator i = fileTypesSubsets.iterator(); i.hasNext(); )
        {
            FileType v = readFileType( "", (Registry) i.next() );
            fileTypes.add( v );
        }
        value.setFileTypes( fileTypes );
        java.util.List knownContentConsumers = new java.util.ArrayList();
        knownContentConsumers.addAll( registry.getList( prefix + "knownContentConsumers.knownContentConsumer" ) );
View Full Code Here

        return value;
    }
   
    private FileType readFileType( String prefix, Registry registry )
    {
        FileType value = new FileType();

        String id = registry.getString( prefix + "id", value.getId() );
        value.setId( id );
        java.util.List patterns = new java.util.ArrayList();
        patterns.addAll( registry.getList( prefix + "patterns.pattern" ) );
        value.setPatterns( patterns );

        return value;
    }
View Full Code Here

        }

        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

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.