| | |
| | | Message successMsg; |
| | | Installation installation = getInstallation(); |
| | | String libPath = getPath(installation.getLibrariesDirectory()); |
| | | String resourcesPath = getPath(installation.getResourcesDirectory()); |
| | | String classesPath = getPath(installation.getClassesDirectory()); |
| | | boolean resourcesDefined = |
| | | Utils.directoryExistsAndIsNotEmpty(resourcesPath); |
| | | boolean classesDefined = |
| | | Utils.directoryExistsAndIsNotEmpty(classesPath); |
| | | ArrayList<String> paths = new ArrayList<String>(); |
| | | paths.add(libPath); |
| | | if (resourcesDefined) |
| | | { |
| | | paths.add(resourcesPath); |
| | | } |
| | | if (classesDefined) |
| | | { |
| | | paths.add(classesPath); |
| | | } |
| | | if (isCli()) { |
| | | if (getUninstallUserData().getRemoveLibrariesAndTools()) { |
| | | String arg; |
| | | if (isWindows()) { |
| | | arg = installation.getUninstallBatFile() + getLineBreak().toString() + |
| | | getTab() + libPath; |
| | | getTab() + getStringFromCollection(paths, |
| | | getLineBreak().toString()); |
| | | } else { |
| | | arg = libPath; |
| | | arg = getStringFromCollection(paths, getLineBreak().toString()); |
| | | } |
| | | successMsg = |
| | | INFO_SUMMARY_UNINSTALL_FINISHED_SUCCESSFULLY_REMOVE_JARFILES_CLI |
| | |
| | | if (getUninstallUserData().getRemoveLibrariesAndTools()) { |
| | | successMsg = |
| | | INFO_SUMMARY_UNINSTALL_FINISHED_SUCCESSFULLY_REMOVE_JARFILES |
| | | .get(libPath); |
| | | .get(getStringFromCollection(paths, getLineBreak().toString())); |
| | | } else { |
| | | successMsg = INFO_SUMMARY_UNINSTALL_FINISHED_SUCCESSFULLY.get(); |
| | | } |
| | |
| | | File quicksetupFile = installation.getQuicksetupJarFile(); |
| | | File openDSFile = installation.getOpenDSJarFile(); |
| | | File librariesFile = installation.getLibrariesDirectory(); |
| | | File activationFile = new File(librariesFile, "activation.jar"); |
| | | File aspectRuntimeFile = new File(librariesFile, "aspectjrt.jar"); |
| | | File resourcesDir = installation.getResourcesDirectory(); |
| | | File classesDir = installation.getClassesDirectory(); |
| | | File uninstallBatFile = installation.getUninstallBatFile(); |
| | | |
| | | boolean canDeleteResourcesDir = |
| | | !Utils.directoryExistsAndIsNotEmpty(resourcesDir.getAbsolutePath()); |
| | | boolean canDeleteClassesDir = |
| | | !Utils.directoryExistsAndIsNotEmpty(classesDir.getAbsolutePath()); |
| | | |
| | | |
| | | File installationPath = installation.getRootDirectory(); |
| | | |
| | | /** |
| | |
| | | boolean[] uData = { |
| | | userData.getRemoveLibrariesAndTools(), |
| | | userData.getRemoveLibrariesAndTools(), |
| | | userData.getRemoveLibrariesAndTools(), |
| | | userData.getRemoveLibrariesAndTools(), |
| | | userData.getRemoveDatabases(), |
| | | userData.getRemoveLogs(), |
| | | userData.getRemoveConfigurationAndSchema(), |
| | |
| | | File[] tmp = { |
| | | installation.getLibrariesDirectory().getCanonicalFile(), |
| | | installation.getBinariesDirectory().getCanonicalFile(), |
| | | installation.getResourcesDirectory().getCanonicalFile(), |
| | | installation.getClassesDirectory().getCanonicalFile(), |
| | | installation.getDatabasesDirectory().getCanonicalFile(), |
| | | installation.getLogsDirectory().getCanonicalFile(), |
| | | installation.getConfigurationDirectory().getCanonicalFile(), |
| | |
| | | boolean accept = |
| | | !installationPath.equals(file) |
| | | && !equalsOrDescendant(file, librariesFile) |
| | | && (canDeleteClassesDir || !equalsOrDescendant(file, classesDir)) |
| | | && (canDeleteResourcesDir || !equalsOrDescendant(file, resourcesDir)) |
| | | && !quicksetupFile.equals(file) |
| | | && !openDSFile.equals(file); |
| | | |