public static boolean backup(File source, Alerts alerts) { try { File backupFile = new File(source.getParent(), source.getName() + ".original"); if (!backupFile.exists()) { copyFile(source, backupFile); } return true; } catch (IOException e) { alerts.addError("Unable to backup " + source.getAbsolutePath() + "; No changes will be made to this file"); return false; } }
public static boolean backup(final File source, final Alerts alerts) { try { final File backupFile = new File(source.getParent(), source.getName() + ".original"); if (!backupFile.exists()) { copyFile(source, backupFile); } return true; } catch (final IOException e) { alerts.addError("Unable to backup " + source.getAbsolutePath() + "; No changes will be made to this file"); return false; } }
private void addTomEEJuli() { final File original = new File(paths.getCatalinaBinDir(), "tomcat-juli.jar"); final File juli = paths.findOpenEJBJar("tomee-juli"); try { Installers.copyFile(juli, new File(original.getAbsolutePath())); if (!juli.delete()) { // remove original juli.deleteOnExit(); } } catch (final IOException e) { alerts.addInfo("Add tomee user to tomcat-users.xml"); } }
private void moveLibs() { final File libs = paths.getCatalinaLibDir(); for (File file : paths.getOpenEJBLibDir().listFiles()) { if (file.isDirectory()) continue; if (!file.getName().endsWith(".jar")) continue; try { Installers.copyFile(file, new File(libs, file.getName())); file.delete(); alerts.addInfo("Copy " + file.getName() + " to lib"); } catch (IOException e) { alerts.addError("Unable to " + file.getName() + " to Tomcat lib directory. This will need to be performed manually.", e); } } }
private void moveLibs() { final File libs = paths.getCatalinaLibDir(); final File[] files = paths.getOpenEJBLibDir().listFiles(); if (files != null) { for (final File file : files) { if (file.isDirectory()) { continue; } if (!file.getName().endsWith(".jar")) { continue; } try { Installers.copyFile(file, new File(libs, file.getName())); if (!file.delete()) { file.deleteOnExit(); } alerts.addInfo("Copy " + file.getName() + " to lib"); } catch (final IOException e) { alerts.addError("Unable to " + file.getName() + " to Tomcat lib directory. This will need to be " + "performed manually.", e); } } } }
private void addJavaeeInEndorsed() { File endorsed = new File(paths.getCatalinaHomeDir(), "endorsed"); endorsed.mkdir(); copyClasses(paths.getJavaEEAPIJar(), new File(endorsed, "annotation-api.jar"), "javax/annotation/.*", null); // a bit odd but we don't want to depend on OSGi and geronimo jaxb api ContextFinder depends on it copyClasses(paths.getJavaEEAPIJar(), new File(endorsed, "jaxb-api.jar"), "javax/xml/bind/.*", "javax/xml/bind/ContextFinder.class"); final File jaxbImpl = new File(endorsed, "jaxb-impl.jar"); if (!jaxbImpl.exists()) { try { Installers.copyFile(paths.getJAXBImpl(), jaxbImpl); } catch (IOException e) { alerts.addError("can't copy " + paths.getJAXBImpl().getPath() + " to " + endorsed.getPath() + "/jaxb-impl.jar"); } } }
Installers.copyFile(paths.getOpenEJBJavaagentJar(), javaagentJar); alerts.addInfo("Copy " + paths.getOpenEJBJavaagentJar().getName() + " to lib"); } catch (IOException e) {
Installers.copyFile(paths.getOpenEJBJavaagentJar(), javaagentJar); alerts.addInfo("Copy " + paths.getOpenEJBJavaagentJar().getName() + " to lib"); } catch (final IOException e) {
Installers.copyFile(paths.getOpenEJBTomcatLoaderJar(), destination); alerts.addInfo("Copy " + paths.getOpenEJBTomcatLoaderJar().getName() + " to lib"); } catch (IOException e) {
Installers.copyFile(paths.getOpenEJBTomcatLoaderJar(), destination); alerts.addInfo("Copy " + paths.getOpenEJBTomcatLoaderJar().getName() + " to lib"); } catch (final IOException e) {