From d42b15e420478dc45785fff6e00b863cc1f8a0f9 Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Thu, 18 Sep 2008 10:14:53 +0000
Subject: [PATCH] These changes are separating the current delivery into  an "Install Layout" (the binaries) and an "Instance Layout" (the user data).

---
 opends/src/guitools/org/opends/guitools/uninstaller/UninstallCliHelper.java |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/uninstaller/UninstallCliHelper.java b/opends/src/guitools/org/opends/guitools/uninstaller/UninstallCliHelper.java
index 66a9241..17bb40a 100644
--- a/opends/src/guitools/org/opends/guitools/uninstaller/UninstallCliHelper.java
+++ b/opends/src/guitools/org/opends/guitools/uninstaller/UninstallCliHelper.java
@@ -68,6 +68,9 @@
 import java.util.Collections;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
 import java.io.IOException;
 import java.net.URI;
 
@@ -981,6 +984,53 @@
       /**
        * {@inheritDoc}
        */
+      public String getInstancePath()
+      {
+        String installPath =  getInstallationPath();
+
+        // look for <installPath>/lib/resource.loc
+        String instancePathFileName = installPath + File.separator + "lib"
+        + File.separator + "resource.loc";
+        File f = new File(instancePathFileName);
+
+        if (! f.exists())
+        {
+          return installPath;
+        }
+
+        BufferedReader reader;
+        try
+        {
+          reader = new BufferedReader(new FileReader(instancePathFileName));
+        }
+        catch (Exception e)
+        {
+          return installPath;
+        }
+
+
+        // Read the first line and close the file.
+        String line;
+        try
+        {
+          line = reader.readLine();
+          return new File(line).getAbsolutePath();
+        }
+        catch (Exception e)
+        {
+          return installPath;
+        }
+        finally
+        {
+          try
+          {
+            reader.close();
+          } catch (Exception e) {}
+        }
+      }
+      /**
+       * {@inheritDoc}
+       */
       public ProgressStep getCurrentProgressStep()
       {
         return UninstallProgressStep.NOT_STARTED;

--
Gitblit v1.10.0