Le 06/12/2017 à 01:46, Krzysztof Szymko a écrit : > Hi, > > I've been reading the guide (http://directory.apache.org/api/user-guide.html) > and I've found the following errors: > > 1) 2.5 - Deleting entries > Simple entry deletion (listing for testDeleteLeafNode()) > DeleteResponse response = connection.delete( > "cn=child1,cn=parent,ou=system" ); > method's signature is: delete(String) - void, so shouldn't it be: > DeleteRequest deleteRequest = new DeleteRequestImpl(); > deleteRequest.setName(new Dn( "cn=child1,cn=parent,ou=system")); > DeleteResponse response = connection.delete(deleteRequest);
Correct. The method throws an exception in this case, so one should use a try...catch around the delete call, or use the code you suggest. Note that the LdapConnection API defines 3 methods for the delete operation : * void delete( Dn dn ) throws LdapException * void delete( String dn ) throws LdapException * DeleteResponse delete( DeleteRequest deleteRequest ) throws LdapException The last method is to be used when you want to add a control to the request. Fixed. > > 2) 2.6 - Modyfing entries > Removing an attribute > typo: attrinute Fixed. Many thanks for the feedback, it's really appreciated and helps improving the rproject ! -- Emmanuel Lecharny Symas.com directory.apache.org