You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2005/11/06 04:35:35 UTC

svn commit: r331064 - /directory/shared/protocol/trunk/common/src/main/java/org/apache/protocol/common/store/LdifFileLoader.java

Author: akarasulu
Date: Sat Nov  5 19:35:33 2005
New Revision: 331064

URL: http://svn.apache.org/viewcvs?rev=331064&view=rev
Log:
slight modification to improve loading of files on classpath

Modified:
    directory/shared/protocol/trunk/common/src/main/java/org/apache/protocol/common/store/LdifFileLoader.java

Modified: directory/shared/protocol/trunk/common/src/main/java/org/apache/protocol/common/store/LdifFileLoader.java
URL: http://svn.apache.org/viewcvs/directory/shared/protocol/trunk/common/src/main/java/org/apache/protocol/common/store/LdifFileLoader.java?rev=331064&r1=331063&r2=331064&view=diff
==============================================================================
--- directory/shared/protocol/trunk/common/src/main/java/org/apache/protocol/common/store/LdifFileLoader.java (original)
+++ directory/shared/protocol/trunk/common/src/main/java/org/apache/protocol/common/store/LdifFileLoader.java Sat Nov  5 19:35:33 2005
@@ -240,11 +240,18 @@
         {
             // if file not on system see if something is bundled with the jar ...
             in = getClass().getResourceAsStream( ldif.getName() );
-
-            if ( in == null )
+            if ( in != null )
+            {
+                return in;
+            }
+            
+            in = ClassLoader.getSystemResourceAsStream( ldif.getName() );
+            if ( in != null )
             {
-                throw new FileNotFoundException( "LDIF file does not exist." );
+                return in;
             }
+
+            throw new FileNotFoundException( "LDIF file does not exist." );
         }
 
         return in;