class MifosViewerServletContextListener extends ViewerServletContextListener {

    File copyBIRTResourcesFromClassPathToFilesystemDirectory(ServletContext servletContext) {
        File directory = new File(System.getProperty("java.io.tmpdir"), "MifosBirtFilesExtractedFromClasspath");
        try {
            directory.mkdirs();
            FileUtils.cleanDirectory(directory);
            copyFromClassPathToDirectory(BIRT_RESOURCES_PATTERN, directory);
        } catch (IOException e) {
            error(servletContext, "getResources(\"" + ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX
                    + BIRT_RESOURCES_PATTERN + "**\") failed: " + e.getMessage(), e);
        }

        return directory;
    }

}