private static void processConfigurationArgs()

in apache-rat-core/src/main/java/org/apache/rat/commandline/Arg.java [626:685]


    private static void processConfigurationArgs(final ArgumentContext context) throws ConfigurationException {
        try {
            Defaults.Builder defaultBuilder = Defaults.builder();
            if (CONFIGURATION.isSelected()) {
                File[] files = CONFIGURATION.getParsedOptionValues(context.getCommandLine());
                for (File file : files) {
                    defaultBuilder.add(file);
                }
            }
            if (CONFIGURATION_NO_DEFAULTS.isSelected()) {
                // display deprecation log if needed.
                context.getCommandLine().hasOption(CONFIGURATION_NO_DEFAULTS.getSelected());
                defaultBuilder.noDefault();
            }
            context.getConfiguration().setFrom(defaultBuilder.build());

            if (FAMILIES_APPROVED.isSelected()) {
                context.getConfiguration().addApprovedLicenseCategories(processArrayArg(context, FAMILIES_APPROVED));
            }
            if (FAMILIES_APPROVED_FILE.isSelected()) {
                context.getConfiguration().addApprovedLicenseCategories(processArrayFile(context, FAMILIES_APPROVED_FILE));
            }
            if (FAMILIES_DENIED.isSelected()) {
                context.getConfiguration().removeApprovedLicenseCategories(processArrayArg(context, FAMILIES_DENIED));
            }
            if (FAMILIES_DENIED_FILE.isSelected()) {
                context.getConfiguration().removeApprovedLicenseCategories(processArrayFile(context, FAMILIES_DENIED_FILE));
            }

            if (LICENSES_APPROVED.isSelected()) {
                context.getConfiguration().addApprovedLicenseIds(processArrayArg(context, LICENSES_APPROVED));
            }

            if (LICENSES_APPROVED_FILE.isSelected()) {
                context.getConfiguration().addApprovedLicenseIds(processArrayFile(context, LICENSES_APPROVED_FILE));
            }
            if (LICENSES_DENIED.isSelected()) {
                context.getConfiguration().removeApprovedLicenseIds(processArrayArg(context, LICENSES_DENIED));
            }

            if (LICENSES_DENIED_FILE.isSelected()) {
                context.getConfiguration().removeApprovedLicenseIds(processArrayFile(context, LICENSES_DENIED_FILE));
            }
            if (COUNTER_MAX.isSelected()) {
                for (String arg : context.getCommandLine().getOptionValues(COUNTER_MAX.getSelected())) {
                    Pair<Counter, Integer> pair = Converters.COUNTER_CONVERTER.apply(arg);
                    int limit = pair.getValue();
                    context.getConfiguration().getClaimValidator().setMax(pair.getKey(), limit < 0 ? Integer.MAX_VALUE : limit);
                }
            }
            if (COUNTER_MIN.isSelected()) {
                for (String arg : context.getCommandLine().getOptionValues(COUNTER_MIN.getSelected())) {
                    Pair<Counter, Integer> pair = Converters.COUNTER_CONVERTER.apply(arg);
                    context.getConfiguration().getClaimValidator().setMin(pair.getKey(), pair.getValue());
                }
            }
        } catch (Exception e) {
            throw ConfigurationException.from(e);
        }
    }