directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r440051 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java
Date Mon, 04 Sep 2006 12:34:08 GMT
Author: ersiner
Date: Mon Sep  4 05:34:08 2006
New Revision: 440051

URL: http://svn.apache.org/viewvc?view=rev&rev=440051
Log:
Fixed resource loading issues.

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java?view=diff&rev=440051&r1=440050&r2=440051
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/sp/JavaStoredProcedureUtils.java
Mon Sep  4 05:34:08 2006
@@ -59,13 +59,14 @@
      * @throws NamingException
      *           If an IO error occurs during reading the class file.
      */
-    public static byte[] getClassFileAsStream( String fullClassName, Class resourceLoader
) throws NamingException
+    public static byte[] getClassFileAsStream( Class clazz ) throws NamingException
     {
+        String fullClassName = clazz.getName();
         int lastDot = fullClassName.lastIndexOf( '.' );
         String classFileName = fullClassName.substring( lastDot + 1 ) + ".class";
         
-        URL url = resourceLoader.getResource( classFileName );
-        InputStream in = resourceLoader.getResourceAsStream( classFileName );
+        URL url = clazz.getResource( classFileName );
+        InputStream in = clazz.getResourceAsStream( classFileName );
         File file = new File( url.getFile() );
         int size = ( int ) file.length();
         byte[] buf = new byte[size];
@@ -98,9 +99,10 @@
      * @throws NamingException
      *           If an error occurs during creating the subcontext.
      */
-    public static void loadStoredProcedureClass( LdapContext ctx, String fullClassName, Class
resourceLoader ) throws NamingException
+    public static void loadStoredProcedureClass( LdapContext ctx, Class clazz ) throws NamingException
     {
-        byte[] buf = getClassFileAsStream( fullClassName, resourceLoader );
+        byte[] buf = getClassFileAsStream( clazz );
+        String fullClassName = clazz.getName();
         
         Attributes attributes = new BasicAttributes( "objectClass", "top", true );
         attributes.get( "objectClass" ).add( "javaClass" );



Mime
View raw message