directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r331064 - /directory/shared/protocol/trunk/common/src/main/java/org/apache/protocol/common/store/LdifFileLoader.java
Date Sun, 06 Nov 2005 03:35:35 GMT
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;



Mime
View raw message