throws PolicyViolationException
{
for ( Entry<String, ? extends DownloadPolicy> entry : policies.entrySet() )
{
String key = entry.getKey();
DownloadPolicy policy = entry.getValue();
String defaultSetting = policy.getDefaultOption();
String setting = StringUtils.defaultString( settings.get( key ), defaultSetting );
log.debug( "Applying [" + key + "] policy with [" + setting + "]" );
try
{
policy.applyPolicy( setting, request, localFile );
}
catch ( PolicyConfigurationException e )
{
log.error( e.getMessage(), e );
}