| | |
| | | |
| | | if (getUserData().getStopServer()) { |
| | | status = UninstallProgressStep.STOPPING_SERVER; |
| | | if (displaySeparator) { |
| | | if (displaySeparator && isVerbose()) { |
| | | notifyListeners(getTaskSeparator()); |
| | | } |
| | | new ServerController(this).stopServer(); |
| | | if (!isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_STOPPING_NON_VERBOSE.get())); |
| | | } |
| | | new ServerController(this).stopServer(!isVerbose()); |
| | | if (!isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | displaySeparator = true; |
| | | } |
| | | if (isWindowsServiceEnabled()) { |
| | | status = UninstallProgressStep.DISABLING_WINDOWS_SERVICE; |
| | | if (displaySeparator) { |
| | | if (displaySeparator && isVerbose()) { |
| | | notifyListeners(getTaskSeparator()); |
| | | } |
| | | disableWindowsService(); |
| | |
| | | Set<String> dbsToDelete = getUninstallUserData().getExternalDbsToRemove(); |
| | | if (dbsToDelete.size() > 0) { |
| | | status = UninstallProgressStep.DELETING_EXTERNAL_DATABASE_FILES; |
| | | if (displaySeparator) { |
| | | if (displaySeparator && isVerbose()) { |
| | | notifyListeners(getTaskSeparator()); |
| | | } |
| | | |
| | |
| | | if (logsToDelete.size() > 0) { |
| | | status = UninstallProgressStep.DELETING_EXTERNAL_LOG_FILES; |
| | | |
| | | if (displaySeparator) { |
| | | if (displaySeparator && isVerbose()) { |
| | | notifyListeners(getTaskSeparator()); |
| | | } |
| | | |
| | |
| | | userData.getRemoveLDIFs() || |
| | | userData.getRemoveLibrariesAndTools() || |
| | | userData.getRemoveLogs(); |
| | | if (displaySeparator && somethingToDelete) { |
| | | if (displaySeparator && somethingToDelete && isVerbose()) { |
| | | notifyListeners(getTaskSeparator()); |
| | | } |
| | | |
| | |
| | | */ |
| | | private void deleteExternalDatabaseFiles(Set<String> dbFiles) |
| | | throws ApplicationException { |
| | | notifyListeners(getFormattedProgressWithLineBreak( |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedProgressWithLineBreak( |
| | | INFO_PROGRESS_DELETING_EXTERNAL_DB_FILES.get())); |
| | | } |
| | | else |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_DELETING_EXTERNAL_DB_FILES_NON_VERBOSE.get())); |
| | | } |
| | | for (String path : dbFiles) { |
| | | deleteRecursively(new File(path)); |
| | | } |
| | | if (!isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDone()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private void deleteExternalLogFiles(Set<String> logFiles) |
| | | throws ApplicationException { |
| | | notifyListeners(getFormattedProgressWithLineBreak( |
| | | INFO_PROGRESS_DELETING_EXTERNAL_LOG_FILES.get())); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedProgressWithLineBreak( |
| | | INFO_PROGRESS_DELETING_EXTERNAL_LOG_FILES.get())); |
| | | } |
| | | else |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_DELETING_EXTERNAL_LOG_FILES_NON_VERBOSE.get())); |
| | | } |
| | | for (String path : logFiles) { |
| | | deleteRecursively(new File(path)); |
| | | } |
| | | if (!isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDone()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private void deleteInstallationFiles(int minRatio, int maxRatio) |
| | | throws ApplicationException { |
| | | notifyListeners(getFormattedProgressWithLineBreak( |
| | | INFO_PROGRESS_DELETING_INSTALLATION_FILES.get())); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedProgressWithLineBreak( |
| | | INFO_PROGRESS_DELETING_INSTALLATION_FILES.get())); |
| | | } |
| | | else |
| | | { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_DELETING_INSTALLATION_FILES_NON_VERBOSE.get())); |
| | | } |
| | | File f = new File(getInstallPathFromClasspath()); |
| | | InstallationFilesToDeleteFilter filter = |
| | | new InstallationFilesToDeleteFilter(); |
| | |
| | | } |
| | | hmRatio.put(UninstallProgressStep.DELETING_INSTALLATION_FILES, maxRatio); |
| | | } |
| | | if (!isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDone()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | private void delete(File file) throws ApplicationException { |
| | | boolean isFile = file.isFile(); |
| | | |
| | | if (isFile) { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_DELETING_FILE.get(file.getAbsolutePath()))); |
| | | } else { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_DELETING_DIRECTORY.get(file.getAbsolutePath()))); |
| | | if (isVerbose()) |
| | | { |
| | | if (isFile) { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_DELETING_FILE.get(file.getAbsolutePath()))); |
| | | } else { |
| | | notifyListeners(getFormattedWithPoints( |
| | | INFO_PROGRESS_DELETING_DIRECTORY.get(file.getAbsolutePath()))); |
| | | } |
| | | } |
| | | |
| | | boolean delete = false; |
| | |
| | | errMsg, null); |
| | | } |
| | | |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | if (isVerbose()) |
| | | { |
| | | notifyListeners(getFormattedDoneWithLineBreak()); |
| | | } |
| | | } |
| | | |
| | | private boolean equalsOrDescendant(File file, File directory) { |