| | |
| | | FileUtils.copyDirectoryToDirectory(srcDir, dataDir); |
| | | srcDir = new File(srcPath, "/META-INF/daten/dav"); |
| | | FileUtils.copyDirectoryToDirectory(srcDir, dataDir); |
| | | // hier noch den context anlegen |
| | | String path = ctx.getRealPath("/"); |
| | | //File appDir = new File(path); |
| | | logger.fine("Catalina Base: " + System.getProperty("catalina.base")); |
| | | //File catalinaBase = appDir.getParentFile().getParentFile(); |
| | | File catalinaBase = new File(System.getProperty("catalina.base")); |
| | | File confLocalhost = new File(catalinaBase, "conf/Catalina/localhost"); |
| | | File dataContext = new File(confLocalhost, "data.xml"); |
| | | srcDir = new File(path, "/META-INF/conf"); |
| | | File dataCtxSrc = new File(srcDir, "data.xml"); |
| | | logger.fine("dataCtxSrc: " + dataCtxSrc.getAbsolutePath()); |
| | | logger.fine("dataContext: " + dataContext.getAbsolutePath()); |
| | | FileUtils.copyFile(dataCtxSrc, dataContext); |
| | | } catch (IOException ex) { |
| | | logger.log(Level.SEVERE, null, ex); |
| | | } |
| | | } |
| | | } |
| | | // hier noch den context anlegen |
| | | String path = ctx.getRealPath("/"); |
| | | //File appDir = new File(path); |
| | | logger.fine("Catalina Base: " + System.getProperty("catalina.base")); |
| | | //File catalinaBase = appDir.getParentFile().getParentFile(); |
| | | File catalinaBase = new File(System.getProperty("catalina.base")); |
| | | File confLocalhost = new File(catalinaBase, "conf/Catalina/localhost"); |
| | | File dataContext = new File(confLocalhost, "data.xml"); |
| | | File srcDir = new File(path, "/META-INF/conf"); |
| | | File dataCtxSrc = new File(srcDir, "data.xml"); |
| | | logger.fine("dataCtxSrc: " + dataCtxSrc.getAbsolutePath()); |
| | | logger.fine("dataContext: " + dataContext.getAbsolutePath()); |
| | | try { |
| | | FileUtils.copyFile(dataCtxSrc, dataContext); |
| | | } catch (IOException ex) { |
| | | logger.log(Level.SEVERE, null, ex); |
| | | } |
| | | } |
| | | |