From 15f4c4af976c56c76be7f45d306618f56157461c Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 06 Jun 2007 20:06:24 +0000
Subject: [PATCH] The commit insures that in all cases instantiation of ApplicationException is done with a localized message since this the message contained in this exception is exposed to end users.
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
index f428ae3..ba4c09d 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -177,22 +177,26 @@
*/
public static String getPath(File f)
{
- try
- {
- /*
- * Do a best effort to avoid having a relative representation (for
- * instance to avoid having ../../../).
- */
- File canonical = f.getCanonicalFile();
- f = canonical;
+ String path = null;
+ if (f != null) {
+ try
+ {
+ /*
+ * Do a best effort to avoid having a relative representation (for
+ * instance to avoid having ../../../).
+ */
+ File canonical = f.getCanonicalFile();
+ f = canonical;
+ }
+ catch (IOException ioe)
+ {
+ /* This is a best effort to get the best possible representation of the
+ * file: reporting the error is not necessary.
+ */
+ }
+ path = f.toString();
}
- catch (IOException ioe)
- {
- /* This is a best effort to get the best possible representation of the
- * file: reporting the error is not necessary.
- */
- }
- return f.toString();
+ return path;
}
/**
--
Gitblit v1.10.0