for ( Entry<String, ? extends DownloadPolicy> entry : policies.entrySet() )
{
// olamy with spring rolehint is now downloadPolicy#hint
// so substring after last # to get the hint as with plexus
String key = StringUtils.substringAfterLast( entry.getKey(), "#" );
DownloadPolicy policy = entry.getValue();
String defaultSetting = policy.getDefaultOption();
String setting = StringUtils.defaultString( settings.get( key ), defaultSetting );
log.debug( "Applying [{}] policy with [{}]", key, setting );
try
{
policy.applyPolicy( setting, request, localFile );
}
catch ( PolicyConfigurationException e )
{
log.error( e.getMessage(), e );
}