IUserContentAccess contentAccess = CdfEngine.getUserContentReader( null );
IReadAccess systemAccess = CdfEngine.getPluginSystemReader( null );
if ( contentAccess.fileExists( resourcePath ) && contentAccess.hasAccess( resourcePath, FileAccess.EXECUTE ) ) {
PluginIOUtils.writeOutAndFlush( out, contentAccess.getFileInputStream( resourcePath ) );
} else if ( systemAccess.fileExists( resourcePath ) ) {
PluginIOUtils.writeOutAndFlush( out, systemAccess.getFileInputStream( resourcePath ) );
} else {
logger.info( " resource not found: " + resourcePath );
}
}