def preview = { def file = new File(servletContext.getRealPath("/WEB-INF/docpreview/${params.resourceId}.swf")) if(!file.exists()){ file = new File(servletContext.getRealPath("/WEB-INF/docpreview/00000000-00000000-0000-00000000-0000.swf")) } response.outputStream << file.newInputStream() }