From 9f04857f46200f98cfe4d57e6a874822bfff8616 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 16 Aug 2006 19:45:25 +0000
Subject: [PATCH] Add a getFileForPath method to the StaticUtils class, and update several server components to use it. This can help ensure that relative paths are evaluated relative to the server root rather than whatever happened to be the current working directory when the start script was launched.
---
opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java b/opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java
index 89de951..d683652 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java
@@ -256,7 +256,8 @@
configEntry.getConfigAttribute(profileDirStub);
if (profileDirAttr != null)
{
- profileDirectory = profileDirAttr.activeValue();
+ profileDirectory =
+ getFileForPath(profileDirAttr.activeValue()).getAbsolutePath();
}
}
catch (Exception e)
@@ -539,7 +540,7 @@
configEntry.getConfigAttribute(profileDirStub);
if (profileDirAttr != null)
{
- File dirFile = new File(profileDirAttr.activeValue());
+ File dirFile = getFileForPath(profileDirAttr.activeValue());
if (! (dirFile.exists() && dirFile.isDirectory()))
{
msgID = MSGID_PLUGIN_PROFILER_INVALID_PROFILE_DIR;
@@ -696,7 +697,7 @@
String dirString = profileDirAttr.pendingValue();
if (! dirString.equals(profileDirectory))
{
- File dirFile = new File(dirString);
+ File dirFile = getFileForPath(dirString);
if (! (dirFile.exists() && dirFile.isDirectory()))
{
msgID = MSGID_PLUGIN_PROFILER_INVALID_PROFILE_DIR;
@@ -707,7 +708,7 @@
}
else
{
- profileDirectory = dirString;
+ profileDirectory = dirFile.getAbsolutePath();
if (detailedResults)
{
--
Gitblit v1.10.0