hi,
I am trying to read an LDIF file that contains a "+" sign in one of the entry and I am getting an exception. Removing the "+" sign removes the exception
The problematic entry in the LDIF is the following entry:
~~~~~~~~~~~~~
dn: extId=tel:+1234,dc=extId,ou=identities,o=Db,dc=o,dc=com
objectClass: top
objectClass: alias
objectClass: extId
extId: tel:+1234
aliasedObjectName: assocId=sip:bob@abc.com,DbId=abc.com,ou=DbData,o=Db,dc=o,dc=com
~~~~~~~~~~~~~~
I am reading with the following :
LDIFReader example_reader = new LDIFReader(simulator.class.getResourceAsStream("example.ldif"));
server.importFromLDIF(false, example_reader);
I tried to escape the "+" sign in different ways but no luck.
Any pointer would be appreciated.
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In LDAP DNs, the plus sign is used to indicate that an RDN has multiple attribute-value pairs (e.g., the DN "givenName=John+sn=Doe,ou=People,dc=example,dc=com" includes both "givenName=John" and "sn=Doe" as values of the RDN).
If you have a plus sign in an RDN value, then you need to escape it by prefixing it with a backslash. In your case, that would be "extId=tel:+1234,dc=extId,ou=identities,o=Db,dc=o,dc=com".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry. I did actually type a backslash when writing the post, but apparently this stupid forum software requires you to type two backslashes to actually get one to show up.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi,
I am trying to read an LDIF file that contains a "+" sign in one of the entry and I am getting an exception. Removing the "+" sign removes the exception
The problematic entry in the LDIF is the following entry:
~~~~~~~~~~~~~
dn: extId=tel:+1234,dc=extId,ou=identities,o=Db,dc=o,dc=com
objectClass: top
objectClass: alias
objectClass: extId
extId: tel:+1234
aliasedObjectName: assocId=sip:bob@abc.com,DbId=abc.com,ou=DbData,o=Db,dc=o,dc=com
~~~~~~~~~~~~~~
I am reading with the following :
I tried to escape the "+" sign in different ways but no luck.
Any pointer would be appreciated.
Thank you.
In LDAP DNs, the plus sign is used to indicate that an RDN has multiple attribute-value pairs (e.g., the DN "givenName=John+sn=Doe,ou=People,dc=example,dc=com" includes both "givenName=John" and "sn=Doe" as values of the RDN).
If you have a plus sign in an RDN value, then you need to escape it by prefixing it with a backslash. In your case, that would be "extId=tel:+1234,dc=extId,ou=identities,o=Db,dc=o,dc=com".
Did you mean tel:\+1234 ?
Geez ... it works now ! Sorry about that. I am quite sure I tried it a couple times though.
Anyways, thanks.
Sorry. I did actually type a backslash when writing the post, but apparently this stupid forum software requires you to type two backslashes to actually get one to show up.