Wednesday, 10 July 2013

How to store image in LDAP?

Image store in LDAP is in OctetString format.
For storing the image through code in LDAP its better to store the image data as a byte[] .
Other wise it in unrecoverable.

How to store Date in eDirectory/ LDAP?

 In edirectory date is  stored in CTIME type which is basically a syntax TIME in terms of eDirectory.
The format of date is "yyyyMMddHHmmssZ" .

So  to save any date in eDirectory use above format.

//
//
{
            Date date=new Date();
            DateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmssZ");
            String taskDate=sdf.format(date);
 //

...........
           attributeSet.add( new LDAPAttribute("<attribute_name>",taskDate));      
...........
...........  
}