public void execute( EnforcerRuleHelper helper )
        throws EnforcerRuleException
    {

        displayOSInfo( helper.getLog(), display );

        if ( allParamsEmpty() )
        {
            throw new EnforcerRuleException( "All parameters can not be empty. You must pick at least one of (family, name, version, arch) or use -Denforcer.os.display=true to see the current OS information." );
        }

        if ( isValidFamily( this.family ) )
        {
            if ( !isAllowed() )
            {
                String message = getMessage();
                if ( StringUtils.isEmpty( message ) )
                {
                    message =
                        ( "OS Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME + " Version: "
                            + Os.OS_VERSION + " is not allowed by" + ( arch != null ? " Arch=" + arch : "" )
                            + ( family != null ? " Family=" + family : "" ) + ( name != null ? " Name=" + name : "" ) + ( version != null ? " Version="
                            + version
                                        : "" ) );
                }
                throw new EnforcerRuleException( message );
            }
        }
        else
        {
            StringBuilder buffer = new StringBuilder( 50 );
            Iterator iter = Os.getValidFamilies().iterator();
            while ( iter.hasNext() )
            {
                buffer.append( iter.next() );
                buffer.append( ", " );
            }
            String help = StringUtils.stripEnd( buffer.toString().trim(), "." );
            throw new EnforcerRuleException( "Invalid Family type used. Valid family types are: " + help );
        }
    }
public void execute ( EnforcerRuleHelper helper ) throws EnforcerRuleException { displayOSInfo ( helper . getLog ( ) , display ) ; if ( allParamsEmpty ( ) ) { throw new EnforcerRuleException ( "All parameters can not be empty. You must pick at least one of (family, name, version, arch) or use -Denforcer.os.display=true to see the current OS information." ) ; } if ( isValidFamily ( this . family ) ) { if ( ! isAllowed ( ) ) { String message = getMessage ( ) ; if ( StringUtils . isEmpty ( message ) ) { message = ( "OS Arch: " + Os . OS_ARCH + " Family: " + Os . OS_FAMILY + " Name: " + Os . OS_NAME + " Version: " + Os . OS_VERSION + " is not allowed by" + ( arch != null ? " Arch=" + arch : "" ) + ( family != null ? " Family=" + family : "" ) + ( name != null ? " Name=" + name : "" ) + ( version != null ? " Version=" + version : "" ) ) ; } throw new EnforcerRuleException ( message ) ; } } else { StringBuilder buffer = new StringBuilder ( 50 ) ; Iterator iter = Os . getValidFamilies ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { buffer . append ( iter . next ( ) ) ; buffer . append ( ", " ) ; } String help = StringUtils . stripEnd ( buffer . toString ( ) . trim ( ) , "." ) ; throw new EnforcerRuleException ( "Invalid Family type used. Valid family types are: " + help ) ; } }
/*
(non-Javadoc)

@see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper)