private void loadKeywords()

in modello-plugins/modello-db-keywords/src/main/java/org/apache/archiva/redback/components/modello/db/SQLReservedWords.java [137:173]


    private void loadKeywords()
    {
        this.keywords = new HashMap<>();

        Properties props = new Properties();

        URL definitionsURL = this.getClass().getResource( "keywords.properties" );

        if ( definitionsURL == null )
        {
            getLogger().error( "Unable to load definition file: keywords.properties" );
            return;
        }

        try (InputStream is = definitionsURL.openStream())
        {
            props.load( is );

            String sources[] = StringUtils.split( props.getProperty( "keyword.sources" ), "," );

            for ( int i = 0; i < sources.length; i++ )
            {
                String source = sources[i];
                String sourceName = props.getProperty( "keyword.source." + source + ".name" );
                String sourceSeverity = props.getProperty( "keyword.source." + source + ".severity" );

                KeywordSource keywordSource = new KeywordSource( sourceName, sourceSeverity );

                loadKeywordSource( source + ".txt", keywordSource );
            }
        }
        catch ( IOException e )
        {
            getLogger().error( "Unable to load definitions file: " + "keywords.properties", e );
            return;
        }
    }