From b471bc6b9f2a087e8bb8e3adc6e5d1b32e80db8d Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 07 Oct 2009 12:43:38 +0000
Subject: [PATCH] Fix for issue 4271 (control-panel: in remote mode, "Installation Path" is incorrect) Since using File when you have different OS in the control panel and in the managed server can be really problematic, use String instead in the ServerDescriptor object.
---
opends/src/server/org/opends/server/tools/status/StatusCli.java | 20 +++-----------------
1 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/status/StatusCli.java b/opends/src/server/org/opends/server/tools/status/StatusCli.java
index 68ae613..af6c62d 100644
--- a/opends/src/server/org/opends/server/tools/status/StatusCli.java
+++ b/opends/src/server/org/opends/server/tools/status/StatusCli.java
@@ -28,7 +28,6 @@
package org.opends.server.tools.status;
import java.io.File;
-import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
@@ -495,18 +494,7 @@
writeHostnameContents(desc, labelWidth);
writeAdministrativeUserContents(desc, labelWidth);
writeInstallPathContents(desc, labelWidth);
- boolean sameInstallAndInstance = true;
- try
- {
- sameInstallAndInstance = desc.getInstancePath().getCanonicalFile().equals(
- desc.getInstallPath().getCanonicalFile());
- }
- catch (IOException ioe)
- {
- // Best effort
- sameInstallAndInstance = desc.getInstancePath().getAbsoluteFile().equals(
- desc.getInstallPath().getAbsoluteFile());
- }
+ boolean sameInstallAndInstance = desc.sameInstallAndInstance();
if (!sameInstallAndInstance)
{
writeInstancePathContents(desc, labelWidth);
@@ -702,9 +690,8 @@
private void writeInstallPathContents(ServerDescriptor desc,
int maxLabelWidth)
{
- File path = desc.getInstallPath();
writeLabelValue(INFO_INSTALLATION_PATH_LABEL.get(),
- Message.raw(path.toString()),
+ Message.raw(desc.getInstallPath()),
maxLabelWidth);
}
@@ -717,9 +704,8 @@
private void writeInstancePathContents(ServerDescriptor desc,
int maxLabelWidth)
{
- File path = desc.getInstancePath();
writeLabelValue(INFO_CTRL_PANEL_INSTANCE_PATH_LABEL.get(),
- Message.raw(path.toString()),
+ Message.raw(desc.getInstancePath()),
maxLabelWidth);
}
--
Gitblit v1.10.0