Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0.0-M10
-
Windows
Description
The method
org.apache.directory.shared.ldap.sp.JavaStoredProcUtils.getClassFileAsStream(clazz: Class<?>): byte[]
returns zero bytes under Windows if the path to the class contains at least one space character. This affects the possibility to load stored procedures. No exception is thrown.
For example:
Reading the file "C:\a a\foo.class" would return zero bytes, because
clazz.getResource( classFileName ).getFile()
returns the String "/C:/a%20a/foo.class". So in the following
URL url = clazz.getResource( classFileName );
File file = new File( url.getFile() );
the file can not be found, because it searches for the "C:/a%20a" directory which doesn't exist.
Solution:
Instead of url.getFile() use url.toURI()