From 26bdd2bc89ec5366d100fe46e99fa6bb60301553 Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Fri, 23 Nov 2007 07:41:29 +0000
Subject: [PATCH] Fix for issue #2614 (ldif connection handler doesn't work with relative path value for ldif-directory property) We check now if it's an absolute path. If it's a relative path, we add the instance root path to get the actual ldif-directory location
---
opends/src/server/org/opends/server/protocols/LDIFConnectionHandler.java | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/opends/src/server/org/opends/server/protocols/LDIFConnectionHandler.java b/opends/src/server/org/opends/server/protocols/LDIFConnectionHandler.java
index 4aea497..8060bed 100644
--- a/opends/src/server/org/opends/server/protocols/LDIFConnectionHandler.java
+++ b/opends/src/server/org/opends/server/protocols/LDIFConnectionHandler.java
@@ -43,6 +43,7 @@
import org.opends.server.api.AlertGenerator;
import org.opends.server.api.ClientConnection;
import org.opends.server.api.ConnectionHandler;
+import org.opends.server.core.DirectoryServer;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.types.ConfigChangeResult;
@@ -133,7 +134,14 @@
public void initializeConnectionHandler(LDIFConnectionHandlerCfg
configuration)
{
- ldifDirectory = new File(configuration.getLDIFDirectory());
+ String ldifDirectoryPath = configuration.getLDIFDirectory();
+ ldifDirectory = new File(ldifDirectoryPath);
+
+ // If we have a relative path to the instance, get the absolute one.
+ if ( ! ldifDirectory.isAbsolute() ) {
+ ldifDirectory = new File(DirectoryServer.getServerRoot() + File.separator
+ + ldifDirectoryPath);
+ }
if (ldifDirectory.exists())
{
--
Gitblit v1.10.0