directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <aok...@bellsouth.net>
Subject Re: Storing binary data in 0.9.1 fails (or data given back from the directory is changed)
Date Mon, 08 Aug 2005 18:01:22 GMT
Emmanuel Lecharny wrote:

>Hi Alex, hi Stefan
>  
>
<snip/>

>I've tested an AddRequest with a PDU which contains a jpegPhoto and a
>byte[] as its value, and I'm not sure that the
>org.apache.ldap.common.berlib.asn1.decoder.add.AddAttributeValueRule.finish() method does
the right thing when creating a String with the bytes it get.
>
>the line before the last line is :
>
>	...
>        // Add the attribute
>        attrs.put( id, new String( octets ) ) ;
>	...
>
>and should be 
>	...
>        // Add the value
>        attrs.put( id, octets ) ;
>	...
>
>
>If the bytes are above 128, you will just transform the bytes to a bad
>Value. I think that the value, as it is supposed to be an OctetString,
>should be stored directly without creating a new String.
>
>wdyt Alex ? 
>  
>
Right and there will also be character encoding issues. 

Hmmm I think this switch from using a String to using a byte[] should be 
based on the attributeType definition.  Question is how do we get that 
to the Rule in a safe and easy manner?

Alex


Mime
View raw message