[prev in list] [next in list] [prev in thread] [next in thread]
List: ldap
Subject: [ldap] If You can help me.
From: Hugo Roberto COLOMBO <hugo () hch ! com ! ar>
Date: 2003-03-19 17:10:18
[Download RAW message or body]
Dear Sir/Madame
The undersigning Hugo Roberto COLOMBO, is facing a trouble when
he is trying to search into a LDAP directory for a Group in order to
get the Members Names, If you have any recomendations he will be very
gratefull with You.
The code I´m using is:
private Vector getAttributes(String dn,String[] attrs)
{
Vector resul=new Vector();
error=null;
try
{
LDAPEntry entry=ld.read(dn,attrs);
for (int j=0;j<attrs.length;j++)
{
LDAPAttribute attr=entry.getAttribute(attrs[j]);
if (attrs[j]!="uniquemember")
{
if (attr==null) {resul.addElement(new
String(EMPTY_ATTR));continue;}
byte[][] vals=attr.getByteValueArray();
if (vals!=null)
{
String aux_attr=null;
for (int k=0;k<vals.length;k++)
{
if (aux_attr==null)
{
aux_attr=new String(vals[k],"UTF8");
}
else
{
aux_attr+=("\n"+new String(vals[k],"UTF8"));
}
}
resul.addElement(aux_attr);
}
else
{
resul.addElement(new String(EMPTY_ATTR));
}
}
else
{
if (attr==null) {resul.addElement(null);continue;}
byte[][] vals=attr.getByteValueArray();
if (vals!=null)
{
String[] aux_members=new String[vals.length];
for (int k=0;k<vals.length;k++) {aux_members[k]=new
String(vals[k],"UTF8");}
resul.addElement(aux_members);
}
else
{
resul.addElement(null);
}
}
}
}
catch(LDAPException e) {error=e.getMessage();}
catch(UnsupportedEncodingException e) {error=e.getMessage();}
catch(Exception e) {error=e.getMessage();}
return resul;
}
From now Thank You.
Hugo Roberto COLOMBO
---
You are currently subscribed to ldap@umich.edu as: [ldap@progressive-comp.com]
To unsubscribe send email to ldap-request@umich.edu with the word UNSUBSCRIBE as the \
SUBJECT of the message.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic