| | |
| | | { |
| | | private boolean isInstalled; |
| | | |
| | | private boolean canOverwriteCurrentInstall; |
| | | |
| | | private String installationMsg; |
| | | |
| | | private String configFileContents; |
| | |
| | | isInstalled = false; |
| | | } else |
| | | { |
| | | boolean dbFileExists = false; |
| | | ArrayList<String> msgs = new ArrayList<String>(); |
| | | |
| | | if (isServerRunning()) |
| | | { |
| | | if (isConfigFileModified() || (getPort() != 389)) |
| | | { |
| | | /* |
| | | * If the config file is not modified and the port is 389 the common |
| | | * case is that there is already a server running on the default port, |
| | | * so it does not correspond to this install. |
| | | */ |
| | | msgs.add(getMsg("installstatus-serverrunning", new String[] |
| | | msgs.add(getMsg("installstatus-serverrunning", new String[] |
| | | { String.valueOf(getPort()) })); |
| | | } |
| | | } |
| | | |
| | | if (dbFilesExist()) |
| | | { |
| | | dbFileExists = true; |
| | | msgs.add(getMsg("installstatus-dbfileexist")); |
| | | } |
| | | |
| | |
| | | { |
| | | msgs.add(getMsg("installstatus-configfilemodified")); |
| | | } |
| | | canOverwriteCurrentInstall = (msgs.size() == 1) && dbFileExists; |
| | | isInstalled = msgs.size() > 0; |
| | | if (isInstalled) |
| | | if (canOverwriteCurrentInstall) |
| | | { |
| | | installationMsg = |
| | | getMsg("installstatus-canoverwritecurrentinstall-msg"); |
| | | } |
| | | else if (isInstalled) |
| | | { |
| | | StringBuffer buf = new StringBuffer(); |
| | | buf.append("<ul>"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Indicates can overwrite current install. |
| | | * |
| | | * @return <CODE>true</CODE> if there is something installed under the |
| | | * binaries that we are running and we can overwrite it and |
| | | * <CODE>false</CODE> if not. |
| | | */ |
| | | public boolean canOverwriteCurrentInstall() |
| | | { |
| | | return canOverwriteCurrentInstall; |
| | | } |
| | | |
| | | /** |
| | | * Provides a localized message to be displayed to the user in HTML format |
| | | * informing of the installation status. |
| | | * |