class NetworkConfigurationManagerImpl implements NetworkConfigurationManager {

    @Override
    public boolean isExcludedFromProxy(final String host)
    {
        Set<String> exclusionPatterns;
        if (getSelectedProxyType() == ConfigurationType.SYSTEM)
        {
            exclusionPatterns = getSystemConfiguration().getExclusionPatterns();
        }
        else if (getSelectedProxyType() == ConfigurationType.MANUAL)
        {
            exclusionPatterns = getManualConfiguration().getExclusionPatterns();
        }
        else
        {
            exclusionPatterns = Collections.emptySet();
        }

        for (final String exclusion : exclusionPatterns)
        {
            // Generate a regular expression from the exclusion string.
            // Treat everything except '*' literally.
            final String[] splitOnStar = exclusion.split("\\*", -1);
            final String pattern = "\\Q" + StringUtilities.join("\\E.*\\Q", splitOnStar) + "\\E";
            if (Pattern.matches(pattern, host))
            {
                if (LOGGER.isDebugEnabled())
                {
                    LOGGER.debug(StringUtilities.concat("Host [", host, "] matches proxy exclusion pattern [", exclusion,
                            "]; not using proxy."));
                }
                return true;
            }
        }
        return false;
    }

    public  NetworkConfigurationManagerImpl(final PreferencesRegistry prefsRegistry);

}