path = path != null && path.endsWith( "/content" ) ? path.substring( 0, path.indexOf( "/content" ) ) : path;
response.setHeader( "Content-Type", MimeHelper.getMimeTypeFromFileName( path ) );
final IPluginResourceLoader resLoader = PentahoSystem.get( IPluginResourceLoader.class, null );
final String formats =
resLoader.getPluginSetting( this.getClass(), CdfConstants.PLUGIN_SETTINGS_DOWNLOADABLE_FORMATS );
List<String> allowedFormats = Arrays.asList( StringUtils.split( formats, ',' ) );
String extension = path.replaceAll( ".*\\.(.*)", "$1" );
if ( allowedFormats.indexOf( extension ) < 0 ) {
// We can't provide this type of file