You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Vitali Baumtrok (Created) (JIRA)" <ji...@apache.org> on 2012/02/22 15:25:48 UTC

[jira] [Created] (DIRAPI-82) Loading class file as stream under Windows bugged

Loading class file as stream under Windows bugged
-------------------------------------------------

                 Key: DIRAPI-82
                 URL: https://issues.apache.org/jira/browse/DIRAPI-82
             Project: Directory Client API
          Issue Type: Bug
    Affects Versions: 1.0.0-M10
         Environment: Windows
            Reporter: Vitali Baumtrok


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()

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DIRAPI-82) Loading class file as stream under Windows bugged

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRAPI-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRAPI-82:
------------------------------------

    Fix Version/s: 1.0.0-M12
    
> Loading class file as stream under Windows bugged
> -------------------------------------------------
>
>                 Key: DIRAPI-82
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-82
>             Project: Directory Client API
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M10
>         Environment: Windows
>            Reporter: Vitali Baumtrok
>              Labels: class, classfile, load, loading, procedures, stored, storedprocedures, windows
>             Fix For: 1.0.0-M12
>
>
> 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()

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DIRAPI-82) Loading class file as stream under Windows bugged

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRAPI-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRAPI-82.
-------------------------------------

    Resolution: Fixed

Thanks for the proposed fixes !

Applied with http://svn.apache.org/viewvc?rev=1332475&view=rev
                
> Loading class file as stream under Windows bugged
> -------------------------------------------------
>
>                 Key: DIRAPI-82
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-82
>             Project: Directory Client API
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M10
>         Environment: Windows
>            Reporter: Vitali Baumtrok
>              Labels: class, classfile, load, loading, procedures, stored, storedprocedures, windows
>
> 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()

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira