directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1628739 - /directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java
Date Wed, 01 Oct 2014 15:35:05 GMT
Author: kayyagari
Date: Wed Oct  1 15:35:05 2014
New Revision: 1628739

URL: http://svn.apache.org/r1628739
Log:
use the given complete file path instead of just the name when the given path is not absolute
(DIRSERVER-2010)

Modified:
    directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java

Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java?rev=1628739&r1=1628738&r2=1628739&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java
(original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java
Wed Oct  1 15:35:05 2014
@@ -274,19 +274,20 @@ public class LdifFileLoader
         }
         else
         {
-            if ( loader != null && ( in = loader.getResourceAsStream( ldif.getName()
) ) != null )
+            // use ldif.getPath() to resolve the relative paths
+            if ( loader != null && ( in = loader.getResourceAsStream( ldif.getPath()
) ) != null )
             {
                 return in;
             }
 
             // if file not on system see if something is bundled with the jar ...
-            in = getClass().getResourceAsStream( ldif.getName() );
+            in = getClass().getResourceAsStream( ldif.getPath() );
             if ( in != null )
             {
                 return in;
             }
 
-            in = ClassLoader.getSystemResourceAsStream( ldif.getName() );
+            in = ClassLoader.getSystemResourceAsStream( ldif.getPath() );
             if ( in != null )
             {
                 return in;



Mime
View raw message