简体   繁体   中英

Unboundid LDAP SDK - how to process an attribute value consisting of several values?

If you have an attribute which value consists of a comma-separated list of values, which would be the best way to retrieve some part of that value?

Example:

myAttribute: value1, value2, value3, value4

So far, I've used regular expressions to do this, but this seems wrong somehow (because I feel there could be a better solution).

I'm using Unboundid LDAP SDK for accessing the LDAP.

Portions of an LDAP attribute value cannot be retrieved. The attribute has a value, and that value is returned to the LDAP client. Perhaps your myAttribute should be multi-valued:

dn: cn=the entry,dc=example,dc=com
myAttribute: value1
myAttribute: value2
myAttribute: value3
myAttribute: value4

If this does not suit your application, then StringTokenizer or java.util.regex will work to split the values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM